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"