nxtgauge-gitops/.forgejo/workflows/sync-to-github.yaml
sync-test 843e732dcf
All checks were successful
sync-to-github / sync (push) Successful in 16s
ci: fix secret name for github mirror sync
GITHUB_MIRROR_TOKEN was rejected by Forgejo (GITHUB_ prefix is
reserved). Renamed to GH_MIRROR_TOKEN and created the secret.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 01:44:52 +05:30

37 lines
979 B
YAML

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:
GH_MIRROR_TOKEN: ${{ secrets.GH_MIRROR_TOKEN }}
run: |
set -euo pipefail
git remote add github-mirror "https://Traceworks2023:${GH_MIRROR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git" 2>/dev/null || \
git remote set-url github-mirror "https://Traceworks2023:${GH_MIRROR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git"
git push github-mirror "HEAD:main"