From fcb40c3590cf870046313c5405f1bea457ba6876 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Fri, 3 Jul 2026 18:59:02 +0530 Subject: [PATCH] ci: sync GitHub pushes to Forgejo --- .github/workflows/sync-to-forgejo.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/sync-to-forgejo.yml diff --git a/.github/workflows/sync-to-forgejo.yml b/.github/workflows/sync-to-forgejo.yml new file mode 100644 index 0000000..07b6182 --- /dev/null +++ b/.github/workflows/sync-to-forgejo.yml @@ -0,0 +1,38 @@ +name: sync-to-forgejo + +on: + push: + branches: + - main + - high-performance + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: sync-to-forgejo-${{ github.ref }} + cancel-in-progress: true + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Push to Forgejo + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + set -euo pipefail + git remote add forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" 2>/dev/null || \ + git remote set-url forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" + git push forgejo "HEAD:${GITHUB_REF#refs/heads/}" --force