fix(ci): auto-sync concurrency + cleanup follow-ups - #2210
Merged
hongmingwang-moleculeai merged 1 commit intoApr 28, 2026
Conversation
Three small fixes from the self-review of #2209: 1. **Required: concurrency group.** Two pushes to main in quick succession (manual UI merge then auto-promote-staging's ff-push, or any back-to-back main pushes) would race two auto-sync runs against the same staging branch — second `git push origin staging` fails non-fast-forward, surfacing as a red CI alert for what should be a no-op. Add `concurrency: { group: auto-sync-main-to-staging, cancel-in-progress: false }` so the second run waits for the first and sees its result. 2. **Hygiene: `git merge --abort` on conflict.** The conflict-error path exits 1 with the work tree in a half-merged state. Doesn't affect future runs (each gets a fresh checkout) but is an unpleasant artifact for anyone who shells into the runner. Abort first, then exit. 3. **Doc accuracy: "Loop safety" comment.** The original said the chain terminates because "main is either a no-op or advances further." That's true but understates the actual safety: GitHub Actions explicitly does NOT trigger downstream workflow runs from `GITHUB_TOKEN`-authored pushes. So the loop is impossible by construction, not just by happy coincidence of ref state. Updated the comment to reflect the actual mechanism. Plus a step-name nit: "Fast-forward staging → main" reads as if main is the target. Renamed to "Fast-forward staging to main" for consistency with the workflow's name (main → staging). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
requested a review
from hongmingwang-moleculeai
as a code owner
April 28, 2026 21:59
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-review follow-ups for #2209. Three small fixes:
Required: concurrency group. Two pushes to main in rapid succession would otherwise race two auto-sync runs; second push fails non-fast-forward and lights up CI red. Adds:
```yaml
concurrency:
group: auto-sync-main-to-staging
cancel-in-progress: false
```
Hygiene: `git merge --abort` on conflict. Leaves the work tree clean before exiting 1 — easier debugging if anyone shells into the runner.
Doc accuracy: "Loop safety" comment. Updated to reflect the actual mechanism — `GITHUB_TOKEN`-authored pushes don't trigger downstream workflows, so the loop is impossible by construction.
Plus a step-name nit: "Fast-forward staging → main" → "Fast-forward staging to main" (workflow direction is main → staging; step name was misleading).
🤖 Generated with Claude Code