From 98bebea186467975869345964649472466a3863c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Sun, 9 Jul 2023 18:23:58 +0200 Subject: [PATCH] Add docu sync for releases --- .github/scripts/sync_docs.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/scripts/sync_docs.sh b/.github/scripts/sync_docs.sh index 3e587add..ff5bc2c1 100755 --- a/.github/scripts/sync_docs.sh +++ b/.github/scripts/sync_docs.sh @@ -60,5 +60,21 @@ if [[ $EVENT == "push" ]]; then elif [[ $EVENT == "release" ]]; then git commit -m "Sync docs for release ${COMMIT_URL}/releases/tag/${TAG_NAME}" fi -git pull -git push https://${TOKEN}@${REPO_URL} + +MAX_RETRIES=5 +DELAY=5 +retry=0 + +while ((retry < MAX_RETRIES)) +do + git push https://${TOKEN}@${REPO_URL} && break + retry=$((retry + 1)) + git pull --rebase + sleep $DELAY +done + +if ((retry == MAX_RETRIES)) +then + echo "Failed to push after $MAX_RETRIES attempts. Exiting with 1." + exit 1 +fi