From f042a82ff124a72d96f36f1d1ba9cecadefe6ef4 Mon Sep 17 00:00:00 2001 From: Igor Krauch <243803173+igareck@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:00:49 -0400 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B5=D1=80=D0=BA=D0=B0=D0=BB=D0=BE=20/?= =?UTF-8?q?=20Mirror=20to=20Codeberg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Создание зеркала на Codeberg.org Create a mirror on Codeberg.org --- .github/workflows/mirror-to-codeberg.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mirror-to-codeberg.yml b/.github/workflows/mirror-to-codeberg.yml index 8cc44f84f..cc2cb22f8 100644 --- a/.github/workflows/mirror-to-codeberg.yml +++ b/.github/workflows/mirror-to-codeberg.yml @@ -2,10 +2,12 @@ name: Mirror to Codeberg on: workflow_dispatch: + # schedule: + # - cron: "17 * * * *" concurrency: group: mirror-to-codeberg - cancel-in-progress: true + cancel-in-progress: false permissions: contents: read @@ -13,6 +15,7 @@ permissions: jobs: mirror: runs-on: ubuntu-latest + timeout-minutes: 20 steps: - name: Checkout GitHub repository @@ -32,4 +35,18 @@ jobs: git remote remove codeberg 2>/dev/null || true git remote add codeberg "https://igareck:${CODEBERG_TOKEN}@codeberg.org/igareck/vpn-configs-for-russia.git" - git push codeberg HEAD:main --force + for attempt in 1 2 3 4 5; do + echo "Codeberg push attempt $attempt/5" + + if git push codeberg HEAD:main --force; then + echo "Codeberg push successful" + exit 0 + fi + + sleep_time=$((attempt * 60)) + echo "Codeberg push failed. Sleeping ${sleep_time}s before retry..." + sleep "$sleep_time" + done + + echo "Codeberg push failed after all retries" + exit 1