fix(ci): rebase-and-retry auto-commit pushes to survive races#14
Merged
AbdullahBakir97 merged 1 commit intomainfrom Apr 27, 2026
Merged
fix(ci): rebase-and-retry auto-commit pushes to survive races#14AbdullahBakir97 merged 1 commit intomainfrom
AbdullahBakir97 merged 1 commit intomainfrom
Conversation
Build-examples and refresh-context both fire on every push to main and both push back. When two workflows race for the same ref, the loser hit `! [rejected] main -> main (fetch first)` and the run failed. Today's morning health-check surfaced exactly this on commit 8217205: build-examples lost the race against refresh-context committing the auto-marker refresh. Fix: replace the bare `git push` with a 3-attempt loop that does `git pull --rebase origin main && git push`, sleeping briefly between attempts. Both auto-commits are pure additive (no conflicts possible), so rebase is safe. Three attempts > the worst observed contention; if all three fail something else is wrong and we want the run to error. Applied symmetrically to both workflows.
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.
Summary
The morning health-check on
mainafter commit 8217205 showedBuild examplesfailing with! [rejected] main -> main (fetch first)— classic push race againstRefresh CONTEXT.mdwhich fired off the same merge.Fix: replace bare
git pushwith a 3-attempt loop:Applied symmetrically to both
build-examples.ymlandrefresh-context.yml. Both auto-commits are purely additive (CONTEXT.md and examples/rendered/ never touch each other), so rebase has no conflicts.Test plan
yaml.safe_load