From c1ea61f5446a1038116d81503b4ee98bef77e79e Mon Sep 17 00:00:00 2001 From: Noah Holt Date: Thu, 5 Nov 2026 12:16:41 -0600 Subject: [PATCH] fix(gitops-bump): rebase and retry when another deploy pushed first Co-Authored-By: Claude Opus 5.5 --- gitops-bump/action.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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