From 98a41d833ad058c141315321dc0ec83c76c63151 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Sun, 12 Jul 2026 23:00:58 +0530 Subject: [PATCH] fix(ci): push gitops updates via GitHub instead of direct-to-Forgejo GITOPS_PAT auth was failing against Forgejo. GitHub is the source of truth for nxtgauge-gitops; push there and let sync-to-forgejo.yml relay to Forgejo, which Flux actually watches. --- .forgejo/workflows/build.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 2487880..83851d5 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -98,22 +98,22 @@ jobs: - name: Update GitOps release env: - GITOPS_SERVER: ${{ secrets.GITOPS_SERVER || 'ci.nxtgauge.com' }} - GITOPS_OWNER: ${{ secrets.GITOPS_OWNER || 'ashwin' }} + GITOPS_GITHUB_OWNER: ${{ secrets.GITOPS_GITHUB_OWNER || 'Traceworks2023' }} GITOPS_REPO: ${{ secrets.GITOPS_REPO || 'nxtgauge-gitops' }} GITOPS_BRANCH: ${{ secrets.GITOPS_BRANCH || 'main' }} - # The gitops repo lives on Forgejo (ci.nxtgauge.com), not GitHub - - # GITEOPS_REPO/GITEOPS_SSH_KEY were never actually configured as - # repo secrets (only GITOPS_GITHUB_* and GITOPS_PAT exist, per - # nxtgauge-backend-rust's already-fixed workflow). Use GITOPS_PAT. - GITOPS_PAT: ${{ secrets.GITOPS_PAT }} + # GitHub is the source of truth for nxtgauge-gitops. Push there; + # the repo's own sync-to-forgejo.yml GitHub Action relays the + # commit to Forgejo, which is what Flux (flux-system GitRepository) + # actually watches. Do not push straight to Forgejo here - that + # bypasses GitHub as source of truth. + GITOPS_GITHUB_TOKEN: ${{ secrets.GITOPS_GITHUB_TOKEN }} SHA: ${{ github.sha }} run: | set -euo pipefail - test -n "${GITOPS_PAT:-}" || { echo "GITOPS_PAT is empty"; exit 1; } + test -n "${GITOPS_GITHUB_TOKEN:-}" || { echo "GITOPS_GITHUB_TOKEN is empty"; exit 1; } GITOPS_DIR=$(mktemp -d) - git clone "https://forgejo-actions:${GITOPS_PAT}@${GITOPS_SERVER}/${GITOPS_OWNER}/${GITOPS_REPO}.git" "$GITOPS_DIR" + git clone "https://${GITOPS_GITHUB_OWNER}:${GITOPS_GITHUB_TOKEN}@github.com/${GITOPS_GITHUB_OWNER}/${GITOPS_REPO}.git" "$GITOPS_DIR" cd "$GITOPS_DIR" git checkout "$GITOPS_BRANCH"