From 708275d73d757868f006362f7551e3e0996088ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Fri, 13 Feb 2026 16:51:43 +0100 Subject: [PATCH] fix(deploy-container): Add retry logic to git push --- publish-container/action.yaml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/publish-container/action.yaml b/publish-container/action.yaml index daad5b6..848efeb 100644 --- a/publish-container/action.yaml +++ b/publish-container/action.yaml @@ -150,7 +150,19 @@ runs: fi git commit -m "ci(prod): deploy ${{ inputs.project }} $IMAGE_TAG" - git push origin main + + # CURSED: Retry logic from head foo + retry=0; git push || retry=1 + [ $retry = 0 ] || for i in 1 2 3; do + if [ $retry = 1 ]; then + sleep 1; retry=0 + git pull --rebase + git push || retry=1 + else + break + fi + done + [ $retry = 0 ] - name: Deploy to staging if: inputs.deploy == 'true' && github.ref_type == 'branch' && github.ref_name == 'main' && inputs.apptainer != 'true' @@ -201,4 +213,16 @@ runs: fi git commit -m "ci(staging): deploy ${{ inputs.project }} $IMAGE_TAG" - git push origin main + + # CURSED: Retry logic from head foo + retry=0; git push || retry=1 + [ $retry = 0 ] || for i in 1 2 3; do + if [ $retry = 1 ]; then + sleep 1; retry=0 + git pull --rebase + git push || retry=1 + else + break + fi + done + [ $retry = 0 ]