mirror of
https://github.com/github/awesome-copilot.git
synced 2026-06-25 17:00:20 +00:00
chore(phase2): retarget all automation and contributor guidance from staged to main (#2122)
* chore(phase2): retarget all automation from staged to main - publish.yml: trigger on main, publish only to marketplace - check-pr-target.yml: invert — now blocks PRs targeting staged, welcomes main - 10 PR validation workflows: branches [staged] → [main] - external-plugin-command-router.yml: --base staged → main (3×), message text - external-plugin-rereview-command.yml: --base staged → main (2×), message text - external-plugin-rereview.yml: staged reference in review comment text - external-plugin-intake.yml: ref: staged checkout → main - external-plugin-pr-quality-gates.yml: ref: staged checkout → main - external-plugin-quality-gates.yml: ref: staged checkout → main - check-plugin-structure.yml: error messages updated for new branch model - contributors.yml: ref and base target → main - setup-labels.yml: targets-main label description updated - cli-for-beginners-sync.md + .lock.yml: base-branch staged → main - codeowner-update.md + .lock.yml: base-branch staged → main - learning-hub-updater.md + .lock.yml: base-branch staged → main Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(phase2): update contributor guidance from staged to main - CONTRIBUTING.md: branch from main, PR targets main; remove Phase 2 gate note - AGENTS.md: PR target + external plugin PR automation references - .github/pull_request_template.md: PR checklist targets main - website/src/content/docs/learning-hub/agentic-workflows.md: PR target Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * aw updates --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,11 +2,10 @@ name: Publish distribution branches
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [staged]
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
SOURCE_BRANCH: staged
|
||||
LEGACY_PUBLISHED_BRANCH: main
|
||||
SOURCE_BRANCH: main
|
||||
MARKETPLACE_BRANCH: marketplace
|
||||
WEBSITE_DEPLOY_REF: main
|
||||
|
||||
@@ -58,17 +57,12 @@ jobs:
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
snapshot_dir="$(mktemp -d)"
|
||||
main_worktree_dir="$(mktemp -d)"
|
||||
marketplace_worktree_dir="$(mktemp -d)"
|
||||
main_publish_ref="refs/heads/publish-${LEGACY_PUBLISHED_BRANCH}"
|
||||
marketplace_publish_ref="refs/heads/publish-${MARKETPLACE_BRANCH}"
|
||||
main_base_sha=""
|
||||
marketplace_base_sha=""
|
||||
|
||||
cleanup() {
|
||||
git worktree remove --force "${main_worktree_dir}" 2>/dev/null || true
|
||||
git worktree remove --force "${marketplace_worktree_dir}" 2>/dev/null || true
|
||||
git update-ref -d "${main_publish_ref}" 2>/dev/null || true
|
||||
git update-ref -d "${marketplace_publish_ref}" 2>/dev/null || true
|
||||
rm -rf "${snapshot_dir}"
|
||||
}
|
||||
@@ -83,10 +77,9 @@ jobs:
|
||||
local branch="$1"
|
||||
local worktree_dir="$2"
|
||||
local publish_ref="$3"
|
||||
local base_sha=""
|
||||
|
||||
git fetch origin "${branch}"
|
||||
base_sha="$(git rev-parse "origin/${branch}")"
|
||||
marketplace_base_sha="$(git rev-parse "origin/${branch}")"
|
||||
git worktree add --force --detach "${worktree_dir}" "origin/${branch}"
|
||||
|
||||
rsync -a --delete \
|
||||
@@ -101,45 +94,22 @@ jobs:
|
||||
git commit -m "chore: publish from ${SOURCE_BRANCH}" --allow-empty
|
||||
git update-ref "${publish_ref}" HEAD
|
||||
)
|
||||
|
||||
if [[ "${branch}" == "${LEGACY_PUBLISHED_BRANCH}" ]]; then
|
||||
main_base_sha="${base_sha}"
|
||||
elif [[ "${branch}" == "${MARKETPLACE_BRANCH}" ]]; then
|
||||
marketplace_base_sha="${base_sha}"
|
||||
fi
|
||||
}
|
||||
|
||||
publish_branch "${LEGACY_PUBLISHED_BRANCH}" "${main_worktree_dir}" "${main_publish_ref}"
|
||||
publish_branch "${MARKETPLACE_BRANCH}" "${marketplace_worktree_dir}" "${marketplace_publish_ref}"
|
||||
|
||||
git fetch origin "${LEGACY_PUBLISHED_BRANCH}" "${MARKETPLACE_BRANCH}"
|
||||
current_main_tip="$(git rev-parse "origin/${LEGACY_PUBLISHED_BRANCH}")"
|
||||
git fetch origin "${MARKETPLACE_BRANCH}"
|
||||
current_marketplace_tip="$(git rev-parse "origin/${MARKETPLACE_BRANCH}")"
|
||||
drift_detected=false
|
||||
if [[ "${current_main_tip}" != "${main_base_sha}" ]]; then
|
||||
echo "Remote branch tip changed: ${LEGACY_PUBLISHED_BRANCH} expected ${main_base_sha}, got ${current_main_tip}"
|
||||
drift_detected=true
|
||||
fi
|
||||
if [[ "${current_marketplace_tip}" != "${marketplace_base_sha}" ]]; then
|
||||
echo "Remote branch tip changed: ${MARKETPLACE_BRANCH} expected ${marketplace_base_sha}, got ${current_marketplace_tip}"
|
||||
drift_detected=true
|
||||
fi
|
||||
if [[ "${drift_detected}" == true ]]; then
|
||||
echo "Concurrent branch update detected during publish. Please rerun the publish workflow."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git push origin --atomic \
|
||||
"${main_publish_ref}:${LEGACY_PUBLISHED_BRANCH}" \
|
||||
"${marketplace_publish_ref}:${MARKETPLACE_BRANCH}"
|
||||
|
||||
git fetch origin "${LEGACY_PUBLISHED_BRANCH}" "${MARKETPLACE_BRANCH}"
|
||||
if ! git diff --quiet "origin/${LEGACY_PUBLISHED_BRANCH}" "origin/${MARKETPLACE_BRANCH}"; then
|
||||
echo "Published branch mismatch detected between ${LEGACY_PUBLISHED_BRANCH} and ${MARKETPLACE_BRANCH}"
|
||||
git --no-pager diff --stat "origin/${LEGACY_PUBLISHED_BRANCH}" "origin/${MARKETPLACE_BRANCH}"
|
||||
exit 1
|
||||
fi
|
||||
echo "Verified published outputs are in sync across ${LEGACY_PUBLISHED_BRANCH} and ${MARKETPLACE_BRANCH}"
|
||||
echo "Successfully published to ${MARKETPLACE_BRANCH}"
|
||||
|
||||
- name: Dispatch website deployment
|
||||
run: gh workflow run deploy-website.yml --ref "${WEBSITE_DEPLOY_REF}"
|
||||
|
||||
Reference in New Issue
Block a user