retry i18n auto-commit on push race

This commit is contained in:
MacRimi
2026-08-15 17:46:45 +02:00
parent 42b4aa2489
commit 58a28dd81e
2 changed files with 41 additions and 2 deletions
+21 -1
View File
@@ -115,4 +115,24 @@ jobs:
Source: ${GITHUB_SHA::7} Source: ${GITHUB_SHA::7}
Triggered by: ${{ github.event_name }}" Triggered by: ${{ github.event_name }}"
git push origin develop # Rebase-and-retry against develop: between the initial
# checkout and this push another workflow (e.g.
# build-translation-cache auto-commit) or a manual push can
# land on develop first, and a naked push fails with
# non-fast-forward — losing the freshly generated translation
# commit. Rebasing the local i18n commit on top of the newer
# HEAD is safe: paths don't overlap with cache/script
# workflows, and the same-branch collisions between two i18n
# runs are already blocked by the concurrency group above.
for attempt in 1 2 3 4 5; do
git fetch origin develop
if git rebase origin/develop && git push origin develop; then
echo "push succeeded on attempt ${attempt}"
exit 0
fi
echo "push attempt ${attempt} failed, retrying..."
git rebase --abort 2>/dev/null || true
sleep $(( attempt * 3 ))
done
echo "push failed after 5 attempts"
exit 1
+20 -1
View File
@@ -96,4 +96,23 @@ jobs:
Source: ${GITHUB_SHA::7} Source: ${GITHUB_SHA::7}
Triggered by: ${{ github.event_name }}" Triggered by: ${{ github.event_name }}"
git push origin develop # Rebase-and-retry against develop: between the initial
# checkout and this push another workflow (e.g.
# build-i18n-messages auto-commit) or a manual push can land
# on develop first, and a naked push fails with
# non-fast-forward — losing the freshly built cache commit.
# Paths don't overlap with the other workflows, and
# same-branch collisions between two cache runs are already
# blocked by the concurrency group.
for attempt in 1 2 3 4 5; do
git fetch origin develop
if git rebase origin/develop && git push origin develop; then
echo "push succeeded on attempt ${attempt}"
exit 0
fi
echo "push attempt ${attempt} failed, retrying..."
git rebase --abort 2>/dev/null || true
sleep $(( attempt * 3 ))
done
echo "push failed after 5 attempts"
exit 1