diff --git a/.github/workflows/mirror-to-bitbucket.yml b/.github/workflows/mirror-to-bitbucket.yml index 4f461e4d2..db32430e8 100644 --- a/.github/workflows/mirror-to-bitbucket.yml +++ b/.github/workflows/mirror-to-bitbucket.yml @@ -8,7 +8,7 @@ on: concurrency: group: mirror-to-bitbucket - cancel-in-progress: true + cancel-in-progress: false permissions: contents: read @@ -16,6 +16,7 @@ permissions: jobs: mirror: runs-on: ubuntu-latest + timeout-minutes: 20 steps: - name: Checkout GitHub repository @@ -33,9 +34,7 @@ jobs: set -euo pipefail # Replace main README only in the temporary GitHub Actions checkout. - curl -fsSL \ - "https://raw.githubusercontent.com/igareck/GoldCaviar/main/Files/README-BITBUCKET.md" \ - -o README.md + curl -fsSL "https://raw.githubusercontent.com/igareck/GoldCaviar/main/Files/README-BITBUCKET.md" -o README.md test -s README.md @@ -59,4 +58,18 @@ jobs: git remote remove bitbucket 2>/dev/null || true git remote add bitbucket "https://x-token-auth:${BITBUCKET_TOKEN}@bitbucket.org/igareck/vpn-configs-for-russia.git" - git push bitbucket HEAD:main --force + for attempt in 1 2 3 4 5; do + echo "Bitbucket push attempt $attempt/5" + + if git push bitbucket HEAD:main --force; then + echo "Bitbucket push successful" + exit 0 + fi + + sleep_time=$((attempt * 45)) + echo "Bitbucket push failed. Sleeping ${sleep_time}s before retry..." + sleep "$sleep_time" + done + + echo "Bitbucket push failed after all retries" + exit 1