From 6dd0f3b6caa261d0dd33c05aa195adf9fc4c2d35 Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Thu, 30 Apr 2026 20:48:06 +0200 Subject: [PATCH] fix(ci): support GITEA_TOKEN secret with fallback --- .github/workflows/sync-to-gitea.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-to-gitea.yml b/.github/workflows/sync-to-gitea.yml index 07fb00a..7b71a3e 100644 --- a/.github/workflows/sync-to-gitea.yml +++ b/.github/workflows/sync-to-gitea.yml @@ -18,15 +18,22 @@ jobs: - name: Sync to Gitea env: - GITEA_TOKEN: ${{ secrets.GITEA_SECRET }} + 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}"