Skip to content

Commit fba319e

Browse files
max-sixtyclaude
andauthored
codex-auth-refresh: write CODEX_AUTH_JSON as a repo secret, not env-scoped (#514)
## Summary #513 over-reached: while correctly moving `CLOUDFLARE_API_TOKEN` to the `cloudflare-deploy` environment, it also changed the codex refresher's `gh secret set` to `--repo "$REPO" --env codex-auth-refresh`, scoping `CODEX_AUTH_JSON` into the `codex-auth-refresh` environment. `CODEX_AUTH_JSON` is the runtime Codex auth that **every consumer workflow** reads (`tend-review`, `tend-mention`, `tend-triage`, `tend-nightly`, `tend-review-runs`). None of them declare `environment: codex-auth-refresh`, so `${{ secrets.CODEX_AUTH_JSON }}` resolved to an empty string and the codex action failed its auth preflight (`No Codex auth configured`) on every consumer run. Verified on a `workflow_dispatch` of `tend-review-runs` against the codex-harness branch. Only `CODEX_REFRESH_PAT` (the secrets-write credential) should be env-scoped. This drops the `--env` flag so the refresher writes `CODEX_AUTH_JSON` back at repo scope, and adds a comment so it doesn't regress. The job keeps `environment: codex-auth-refresh` to read the env-scoped PAT — env-scoped jobs still see repo secrets, so it reads/writes `CODEX_AUTH_JSON` at repo scope. The `worker-deploy` → `cloudflare-deploy` parts of #513 are correct and untouched. ## Test plan - [ ] Pre-commit + actionlint pass (verified locally) - [ ] After merge: trigger `codex-auth-refresh` — it reads the still-env-scoped valid token, writes a repo-level `CODEX_AUTH_JSON` - [ ] Confirm `CODEX_AUTH_JSON` appears as a repo secret - [ ] Delete the now-redundant env-scoped `CODEX_AUTH_JSON` - [ ] Re-run `tend-review-runs` on the codex branch — codex authenticates Co-authored-by: Claude <[email protected]>
1 parent 2528ca9 commit fba319e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/codex-auth-refresh.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ jobs:
9090
fi
9191
done
9292
93-
printf '%s' "$NEW_AUTH" | gh secret set CODEX_AUTH_JSON --repo "$REPO" --env codex-auth-refresh
93+
# Repo secret, NOT --env: every consumer workflow (review,
94+
# mention, triage, nightly, …) reads CODEX_AUTH_JSON and none
95+
# declare this environment. Only CODEX_REFRESH_PAT is env-scoped.
96+
printf '%s' "$NEW_AUTH" | gh secret set CODEX_AUTH_JSON --repo "$REPO"
9497
9598
EXP=$(printf '%s' "$NEW_AUTH" | jq -r '.tokens.access_token' \
9699
| awk -F. '{print $2}' \

0 commit comments

Comments
 (0)