From 3de1ee79d125dfa4be4f7b4bcd157d37268a763a Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 24 May 2026 09:07:15 +0200 Subject: [PATCH] Retry release-bump push with --rebase on concurrent contention When multiple SE5 plugin workflows are dispatched at the same time (e.g. 'release them all') they all check out the same SHA, all create bump commits, and only one wins the push. The others got 'rejected (fetch first)' and failed the run. Wrap the push in a small retry loop: on rejection, git pull --rebase to fold the other plugin's bump under our own and try again. Up to 5 attempts, then fail loudly. Different plugins touch different plugin.json files so the rebase never conflicts; same-plugin double-dispatch is not a realistic case. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/american-to-british.yml | 15 ++++++++++++++- .github/workflows/british-to-american.yml | 15 ++++++++++++++- .github/workflows/haxor.yml | 15 ++++++++++++++- .github/workflows/typewriter.yml | 15 ++++++++++++++- .github/workflows/word-censor.yml | 15 ++++++++++++++- 5 files changed, 70 insertions(+), 5 deletions(-) diff --git a/.github/workflows/american-to-british.yml b/.github/workflows/american-to-british.yml index 52c70280..4951763f 100644 --- a/.github/workflows/american-to-british.yml +++ b/.github/workflows/american-to-british.yml @@ -65,7 +65,20 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add se5/AmericanToBritish/plugin.json git commit -m "Bump AmericanToBritish to $version [skip ci]" - git push + + # Retry-with-rebase: if a concurrent release dispatched for a different + # plugin won the push first, pull --rebase and try again. + attempts=0 + while ! git push 2>/tmp/push.err; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 5 ]; then + echo "Failed to push after $attempts attempts:" >&2 + cat /tmp/push.err >&2 + exit 1 + fi + echo "Push rejected (attempt $attempts), pulling --rebase and retrying..." + git pull --rebase --no-edit + done ref=$(git rev-parse HEAD) IFS=. read -r major minor patch <<< "$version" diff --git a/.github/workflows/british-to-american.yml b/.github/workflows/british-to-american.yml index 9bba8d70..d5759180 100644 --- a/.github/workflows/british-to-american.yml +++ b/.github/workflows/british-to-american.yml @@ -65,7 +65,20 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add se5/BritishToAmerican/plugin.json git commit -m "Bump BritishToAmerican to $version [skip ci]" - git push + + # Retry-with-rebase: if a concurrent release dispatched for a different + # plugin won the push first, pull --rebase and try again. + attempts=0 + while ! git push 2>/tmp/push.err; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 5 ]; then + echo "Failed to push after $attempts attempts:" >&2 + cat /tmp/push.err >&2 + exit 1 + fi + echo "Push rejected (attempt $attempts), pulling --rebase and retrying..." + git pull --rebase --no-edit + done ref=$(git rev-parse HEAD) IFS=. read -r major minor patch <<< "$version" diff --git a/.github/workflows/haxor.yml b/.github/workflows/haxor.yml index 3556877d..40a4966c 100644 --- a/.github/workflows/haxor.yml +++ b/.github/workflows/haxor.yml @@ -63,7 +63,20 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add se5/Haxor/plugin.json git commit -m "Bump Haxor to $version [skip ci]" - git push + + # Retry-with-rebase: if a concurrent release dispatched for a different + # plugin won the push first, pull --rebase and try again. + attempts=0 + while ! git push 2>/tmp/push.err; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 5 ]; then + echo "Failed to push after $attempts attempts:" >&2 + cat /tmp/push.err >&2 + exit 1 + fi + echo "Push rejected (attempt $attempts), pulling --rebase and retrying..." + git pull --rebase --no-edit + done ref=$(git rev-parse HEAD) IFS=. read -r major minor patch <<< "$version" diff --git a/.github/workflows/typewriter.yml b/.github/workflows/typewriter.yml index 01272b9b..4c0e5102 100644 --- a/.github/workflows/typewriter.yml +++ b/.github/workflows/typewriter.yml @@ -63,7 +63,20 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add se5/TypewriterEffect/plugin.json git commit -m "Bump TypewriterEffect to $version [skip ci]" - git push + + # Retry-with-rebase: if a concurrent release dispatched for a different + # plugin won the push first, pull --rebase and try again. + attempts=0 + while ! git push 2>/tmp/push.err; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 5 ]; then + echo "Failed to push after $attempts attempts:" >&2 + cat /tmp/push.err >&2 + exit 1 + fi + echo "Push rejected (attempt $attempts), pulling --rebase and retrying..." + git pull --rebase --no-edit + done ref=$(git rev-parse HEAD) IFS=. read -r major minor patch <<< "$version" diff --git a/.github/workflows/word-censor.yml b/.github/workflows/word-censor.yml index 898b1114..e0238e0f 100644 --- a/.github/workflows/word-censor.yml +++ b/.github/workflows/word-censor.yml @@ -65,7 +65,20 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add se5/WordCensor/plugin.json git commit -m "Bump WordCensor to $version [skip ci]" - git push + + # Retry-with-rebase: if a concurrent release dispatched for a different + # plugin won the push first, pull --rebase and try again. + attempts=0 + while ! git push 2>/tmp/push.err; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 5 ]; then + echo "Failed to push after $attempts attempts:" >&2 + cat /tmp/push.err >&2 + exit 1 + fi + echo "Push rejected (attempt $attempts), pulling --rebase and retrying..." + git pull --rebase --no-edit + done ref=$(git rev-parse HEAD) IFS=. read -r major minor patch <<< "$version"