fix(ci): preserve deployment target workflows - #39
Conversation
Overlay .github/workflows from the deployment target branch before creating the mirror commit so source-repo CI workflows do not replace deployment-target release and validation workflows. Validation: - bash scripts/test-auto-ff-matrix-pilot-sync-workflow.sh - bash scripts/test-sync-upstream-workflow.sh - bash scripts/test-pipeline-control-sync-workflow.sh - git diff --check [skip-regression-check]
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83d5b36e68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -euo pipefail | ||
| git fetch deployment_mirror "refs/heads/${TARGET_BRANCH}:refs/remotes/deployment_mirror/${TARGET_BRANCH}" | ||
| rm -rf .github/workflows | ||
| git checkout "refs/remotes/deployment_mirror/${TARGET_BRANCH}" -- .github/workflows |
There was a problem hiding this comment.
Remove source-only workflow entries from the index
When the source branch has a workflow file that deployment-target deleted or renamed, this checkout runs in Git's default overlay mode (git checkout -h documents --overlay as the default), so it restores target files but does not remove source-only entries that are already in the index. The preceding rm -rf only deletes the worktree copy, and the later git write-tree builds the mirror commit from the index, so those source workflows still get pushed to the deployment mirror instead of leaving the target workflows authoritative.
Useful? React with 👍 / 👎.
Summary
Validation