fix(ci): push gitops updates via GitHub instead of direct-to-Forgejo
Some checks failed
build-and-release / build (push) Failing after 57s

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.
This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-12 23:00:58 +05:30
parent 697a4b0d92
commit 98a41d833a

View file

@ -98,22 +98,22 @@ jobs:
- name: Update GitOps release - name: Update GitOps release
env: env:
GITOPS_SERVER: ${{ secrets.GITOPS_SERVER || 'ci.nxtgauge.com' }} GITOPS_GITHUB_OWNER: ${{ secrets.GITOPS_GITHUB_OWNER || 'Traceworks2023' }}
GITOPS_OWNER: ${{ secrets.GITOPS_OWNER || 'ashwin' }}
GITOPS_REPO: ${{ secrets.GITOPS_REPO || 'nxtgauge-gitops' }} GITOPS_REPO: ${{ secrets.GITOPS_REPO || 'nxtgauge-gitops' }}
GITOPS_BRANCH: ${{ secrets.GITOPS_BRANCH || 'main' }} GITOPS_BRANCH: ${{ secrets.GITOPS_BRANCH || 'main' }}
# The gitops repo lives on Forgejo (ci.nxtgauge.com), not GitHub - # GitHub is the source of truth for nxtgauge-gitops. Push there;
# GITEOPS_REPO/GITEOPS_SSH_KEY were never actually configured as # the repo's own sync-to-forgejo.yml GitHub Action relays the
# repo secrets (only GITOPS_GITHUB_* and GITOPS_PAT exist, per # commit to Forgejo, which is what Flux (flux-system GitRepository)
# nxtgauge-backend-rust's already-fixed workflow). Use GITOPS_PAT. # actually watches. Do not push straight to Forgejo here - that
GITOPS_PAT: ${{ secrets.GITOPS_PAT }} # bypasses GitHub as source of truth.
GITOPS_GITHUB_TOKEN: ${{ secrets.GITOPS_GITHUB_TOKEN }}
SHA: ${{ github.sha }} SHA: ${{ github.sha }}
run: | run: |
set -euo pipefail 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) 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" cd "$GITOPS_DIR"
git checkout "$GITOPS_BRANCH" git checkout "$GITOPS_BRANCH"