name: sync-to-gitea on: push: branches: - high-performance jobs: sync: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Sync to Gitea env: GITEA_TOKEN_PRIMARY: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN_FALLBACK: ${{ secrets.GITEA_SECRET }} REPO: ${{ github.event.repository.name }} BRANCH: ${{ github.ref_name }} run: | set -euo pipefail GITEA_TOKEN="${GITEA_TOKEN_PRIMARY:-${GITEA_TOKEN_FALLBACK:-}}" if [ -z "${GITEA_TOKEN}" ]; then echo "Missing GITEA token secret. Set GITEA_TOKEN (preferred) or GITEA_SECRET." exit 1 fi git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" GITEA_URL="https://Admin:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/${REPO}.git" echo "Sync target: Admin/${REPO}.git on branch ${BRANCH}" git remote remove gitea 2>/dev/null || true git remote add gitea "${GITEA_URL}" git ls-remote "${GITEA_URL}" >/dev/null git push "${GITEA_URL}" "HEAD:${BRANCH}" --force git push "${GITEA_URL}" --tags --force