Skip to content

Commit 3de1ee7

Browse files
niksedkclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 002ef94 commit 3de1ee7

5 files changed

Lines changed: 70 additions & 5 deletions

File tree

.github/workflows/american-to-british.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,20 @@ jobs:
6565
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6666
git add se5/AmericanToBritish/plugin.json
6767
git commit -m "Bump AmericanToBritish to $version [skip ci]"
68-
git push
68+
69+
# Retry-with-rebase: if a concurrent release dispatched for a different
70+
# plugin won the push first, pull --rebase and try again.
71+
attempts=0
72+
while ! git push 2>/tmp/push.err; do
73+
attempts=$((attempts + 1))
74+
if [ "$attempts" -ge 5 ]; then
75+
echo "Failed to push after $attempts attempts:" >&2
76+
cat /tmp/push.err >&2
77+
exit 1
78+
fi
79+
echo "Push rejected (attempt $attempts), pulling --rebase and retrying..."
80+
git pull --rebase --no-edit
81+
done
6982
ref=$(git rev-parse HEAD)
7083
7184
IFS=. read -r major minor patch <<< "$version"

.github/workflows/british-to-american.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,20 @@ jobs:
6565
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6666
git add se5/BritishToAmerican/plugin.json
6767
git commit -m "Bump BritishToAmerican to $version [skip ci]"
68-
git push
68+
69+
# Retry-with-rebase: if a concurrent release dispatched for a different
70+
# plugin won the push first, pull --rebase and try again.
71+
attempts=0
72+
while ! git push 2>/tmp/push.err; do
73+
attempts=$((attempts + 1))
74+
if [ "$attempts" -ge 5 ]; then
75+
echo "Failed to push after $attempts attempts:" >&2
76+
cat /tmp/push.err >&2
77+
exit 1
78+
fi
79+
echo "Push rejected (attempt $attempts), pulling --rebase and retrying..."
80+
git pull --rebase --no-edit
81+
done
6982
ref=$(git rev-parse HEAD)
7083
7184
IFS=. read -r major minor patch <<< "$version"

.github/workflows/haxor.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,20 @@ jobs:
6363
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6464
git add se5/Haxor/plugin.json
6565
git commit -m "Bump Haxor to $version [skip ci]"
66-
git push
66+
67+
# Retry-with-rebase: if a concurrent release dispatched for a different
68+
# plugin won the push first, pull --rebase and try again.
69+
attempts=0
70+
while ! git push 2>/tmp/push.err; do
71+
attempts=$((attempts + 1))
72+
if [ "$attempts" -ge 5 ]; then
73+
echo "Failed to push after $attempts attempts:" >&2
74+
cat /tmp/push.err >&2
75+
exit 1
76+
fi
77+
echo "Push rejected (attempt $attempts), pulling --rebase and retrying..."
78+
git pull --rebase --no-edit
79+
done
6780
ref=$(git rev-parse HEAD)
6881
6982
IFS=. read -r major minor patch <<< "$version"

.github/workflows/typewriter.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,20 @@ jobs:
6363
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6464
git add se5/TypewriterEffect/plugin.json
6565
git commit -m "Bump TypewriterEffect to $version [skip ci]"
66-
git push
66+
67+
# Retry-with-rebase: if a concurrent release dispatched for a different
68+
# plugin won the push first, pull --rebase and try again.
69+
attempts=0
70+
while ! git push 2>/tmp/push.err; do
71+
attempts=$((attempts + 1))
72+
if [ "$attempts" -ge 5 ]; then
73+
echo "Failed to push after $attempts attempts:" >&2
74+
cat /tmp/push.err >&2
75+
exit 1
76+
fi
77+
echo "Push rejected (attempt $attempts), pulling --rebase and retrying..."
78+
git pull --rebase --no-edit
79+
done
6780
ref=$(git rev-parse HEAD)
6881
6982
IFS=. read -r major minor patch <<< "$version"

.github/workflows/word-censor.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,20 @@ jobs:
6565
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6666
git add se5/WordCensor/plugin.json
6767
git commit -m "Bump WordCensor to $version [skip ci]"
68-
git push
68+
69+
# Retry-with-rebase: if a concurrent release dispatched for a different
70+
# plugin won the push first, pull --rebase and try again.
71+
attempts=0
72+
while ! git push 2>/tmp/push.err; do
73+
attempts=$((attempts + 1))
74+
if [ "$attempts" -ge 5 ]; then
75+
echo "Failed to push after $attempts attempts:" >&2
76+
cat /tmp/push.err >&2
77+
exit 1
78+
fi
79+
echo "Push rejected (attempt $attempts), pulling --rebase and retrying..."
80+
git pull --rebase --no-edit
81+
done
6982
ref=$(git rev-parse HEAD)
7083
7184
IFS=. read -r major minor patch <<< "$version"

0 commit comments

Comments
 (0)