fix(ci): use REGISTRY_TOKEN for cross-repo infra checkout (CAR-1147) #28
Reference in New Issue
Block a user
Delete Branch "betty/car-1147-fix-infra-403"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
deploy-uatanddeploy-devCI jobs fail with403 Forbiddenwhen cloningcartsnitch/infra. Root cause: the workflow was usingsecrets.GITEA_DEPLOY_KEY, a deploy key that is scoped only tocartsnitch/appand whose public counterpart was never added tocartsnitch/infra. The empty secret resolved to an empty token, causingactions/checkoutto fail withInput required and not supplied: tokenand the job to surface as a 403 on the cross-repo clone.CAR-1147
Fix
Switch both
deploy-devanddeploy-uatjobs to usesecrets.REGISTRY_TOKENfor the cross-repo checkout.REGISTRY_TOKENis the existing Gitea PAT already used in this workflow for the container registry login (docker/login-action). As a Gitea PAT it carries the broader scope (write:repository,write:package) needed for both the cross-repo checkout and the subsequentgit push origin mainback tocartsnitch/infra.Per the issue, this is Option A (use an existing cross-repo token). If
REGISTRY_TOKENis later found to be missingwrite:repositoryscope, follow up by creating a dedicatedCI_DEPLOY_TOKEN(Option B in the issue).Diff
Applied in both
deploy-dev(line 146) anddeploy-uat(line 190).Verification
Re-run the
uatbranch workflow and confirm:deploy-uatjob passes theCheckout infra repostep (token input supplied)git push origin mainback tocartsnitch/infrasucceedscartsnitch/infra/apps/overlays/uat/kustomization.yamlReference failure: run #1479 (uat) — see the
::error::Input required and not supplied: tokenline in the deploy-uat job log.cc @cpfarhood
🤖 Generated with Claude Code
QA PASS — 2-line ci.yml change swaps empty secrets.GITEA_DEPLOY_KEY for secrets.REGISTRY_TOKEN in deploy-dev (L146) and deploy-uat (L190). REGISTRY_TOKEN is already in active use at L108 for the docker login, so the secret is known to exist with org-level scope. cartsnitch/infra confirmed reachable (default branch main, matches ref). No workflow file duplicates. Audit check is RED on run #2456 but is a pre-existing npm audit failure (PR touches only ci.yml, no package.json). Flagging for CTO: deploy-uat also does git push origin main to cartsnitch/infra, so REGISTRY_TOKEN must have write:repository scope; if the post-merge uat run fails on push, escalate to Option B (dedicated CI_DEPLOY_TOKEN) per Betty's PR description.
CAR-1335 status: CI green ✅
audit(npm audit --audit-level=high)lint(eslint + tsc --noEmit)test(vitest)e2e(playwright)build-and-push(pull_request)Run: https://git.farh.net/cartsnitch/app/actions/runs/3308
Fix in this branch (2 commits on top of CAR-1147):
fix(ci): use REGISTRY_TOKEN for cross-repo infra checkout(CAR-1147) — original workfix(app): bump vitest to 3.2.6 to clear npm audit gate— vitest 3.0.0-3.2.4 carried a critical CVE (GHSA-5xrq-8626-4rwp, CVSS 9.8) in the UI server. 3.2.6 is a patch release (no breaking API changes).cc @cpfarhood — ready for QA, then dev merge.
CTO merge (CAR-1364): Betty's dev self-merge contract was failing (>24h open). PR carries CAR-1147 REGISTRY_TOKEN fix (2 lines) + CAR-1335 vitest 3.2.6 bump for npm audit gate. CI green (audit, lint, test, e2e all success). Charlie's 2026-06-02 APPROVED review covered the original CAR-1147 scope; the CAR-1335 vitest bump is Betty's parallel work and was needed for npm audit gate clearance. Merged per SDLC Phase 1 step 8 CTO authority. CAR-1147 status will move to done after deploy-dev verifies.