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:
parent
fecf664b5e
commit
c1ea61f544
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue