fix(ci): handle concurrent update-docs runs#4235
Merged
Merged
Conversation
When two pushes to main trigger update-docs simultaneously, the second run's `git stash pop` fails because the first run already pushed the same binary files (PNGs). Replace stash/pull/pop with commit-first then `git pull --rebase -X ours` so binary conflicts resolve in favor of the freshly generated files, plus a retry loop for the residual race.
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.
When two pushes to
maintriggerupdate-docsconcurrently, the second run'sgit stash popfails: the first run already pushed the same binary files (PNGs) tomaps-docs, so git can't restore untracked files from the stash on top of them.|| truehid the error but left the repo in a broken state, causing the commit to find nothing to commit → exit 1.Fix: drop the stash entirely. Instead, commit the generated files first, then
git pull --rebase -X ours origin main(which replays our commit on top of the latest remote, taking our freshly generated version for any binary conflicts), then push. A 3-attempt retry loop handles the residual race where another run pushes between our pull and push.Reproducer
Two pushes to
mainin quick succession (e.g. a merge + version bump) each spend ~3min generating docs, then race to push tomaps-docs. Example failing run: https://github.com/rnmapbox/maps/actions/runs/28312708283/job/83880193652