fix(gitops-bump): rebase and retry when another deploy pushed first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Noah Holt 2026-11-05 12:16:41 -06:00
parent fecf664b5e
commit c1ea61f544

View file

@ -37,4 +37,12 @@ runs:
cd "$DIR"
git -c user.name=ci-bot -c user.email=ci-bot@forgejo.local \
commit -am "${{ inputs.app-name }}: deploy $TAG" || { echo "tag unchanged, nothing to deploy"; exit 0; }
git push
# Another app's deploy may push first: rebase (touches a different dir) and retry.
for i in 1 2 3 4 5; do
git push && exit 0
echo "push rejected (attempt $i), rebasing"
sleep $((i * 2))
git pull --rebase
done
echo "gitops push failed after 5 attempts" >&2
exit 1