From 13a42145da345b2296d63807b787eb9773d22235 Mon Sep 17 00:00:00 2001 From: jtcrde Date: Wed, 12 Aug 2026 15:46:17 +0800 Subject: [PATCH] TRU-329: Rebase-and-retry on auto-bump push races (fix) --- .github/workflows/update-source-reference.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-source-reference.yaml b/.github/workflows/update-source-reference.yaml index 832d9c6..f87117a 100644 --- a/.github/workflows/update-source-reference.yaml +++ b/.github/workflows/update-source-reference.yaml @@ -157,6 +157,16 @@ jobs: fi else echo "Major version was not changed, merging to ${DEFAULT_BRANCH}" - git push origin "$DEFAULT_BRANCH" + # Concurrent package releases race on this push (no shared lock across + # repos) — rebase and retry instead of failing on non-fast-forward. + for attempt in 1 2 3; do + if git push origin "$DEFAULT_BRANCH"; then + break + fi + echo "Push rejected (attempt $attempt) — rebasing onto latest $DEFAULT_BRANCH" + git fetch origin "$DEFAULT_BRANCH" + git rebase "origin/$DEFAULT_BRANCH" + [ "$attempt" = "3" ] && { echo "::error::Push failed after 3 attempts"; exit 1; } + done fi popd