fix(ci): push gitops updates via GitHub instead of direct-to-Forgejo
Some checks failed
build-and-release / build (push) Failing after 57s
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:
parent
697a4b0d92
commit
98a41d833a
1 changed files with 9 additions and 9 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue