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"