From 93d0e94615534918b7d9617d103ba587c6459387 Mon Sep 17 00:00:00 2001 From: sync-test Date: Tue, 4 Aug 2026 01:12:39 +0530 Subject: [PATCH] ci: add sync-to-github workflow to keep GitHub gitops mirror current MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Forgejo-hosted gitops repo is what Flux actually watches and where every deploy commit lands, but nothing pushed those commits to the GitHub mirror — it silently drifted ~80 commits behind. This mirrors the existing GitHub->Forgejo sync pattern used in the app repos, just reversed. Requires a GITHUB_MIRROR_TOKEN repo secret in Forgejo (GitHub PAT with push access to Traceworks2023/nxtgauge-gitops) — added manually since secret values can't be set via this session. Co-Authored-By: Claude Sonnet 5 --- .forgejo/workflows/sync-to-github.yaml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .forgejo/workflows/sync-to-github.yaml diff --git a/.forgejo/workflows/sync-to-github.yaml b/.forgejo/workflows/sync-to-github.yaml new file mode 100644 index 0000000..4337175 --- /dev/null +++ b/.forgejo/workflows/sync-to-github.yaml @@ -0,0 +1,37 @@ +name: sync-to-github + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: sync-to-github-${{ 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 "forgejo-actions[bot]" + git config user.email "forgejo-actions@ci.nxtgauge.com" + + - name: Push to GitHub + env: + GITHUB_MIRROR_TOKEN: ${{ secrets.GITHUB_MIRROR_TOKEN }} + run: | + set -euo pipefail + git remote add github-mirror "https://Traceworks2023:${GITHUB_MIRROR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git" 2>/dev/null || \ + git remote set-url github-mirror "https://Traceworks2023:${GITHUB_MIRROR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git" + git push github-mirror "HEAD:main"