diff --git a/gitops-bump/action.yaml b/gitops-bump/action.yaml index efa8209..d8296ed 100644 --- a/gitops-bump/action.yaml +++ b/gitops-bump/action.yaml @@ -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