Repository navigation
feat(sync-standards): run App-token jobs in a caller environment - #707
Conversation
Add an `environment` input (default `standards-sync`) and declare it, with `deployment: false`, on the attest and sync jobs, the only jobs that read the App secrets. A caller can then hold the App key as an environment secret whose deployment-branch policy allows only the default branch. Repository-level secrets still resolve inside an environment that defines none, so callers keep working before the key moves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 4m 36s —— View job Security review — PR #707
No security issues found. This PR adds a caller-configurable One candidate was hunted and adversarially verified before being dropped, noted here for context rather than as a finding: the PR's own doc comment and README both assert GitHub Actions hardening items (triggers, |
|
Claude finished @kyle-sexton's task in 2m 30s —— View job Code review complete
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41cb5a401c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-review has reviewed this pull request through 8e770a0; a later push is reviewed from there. |
|
claude-security-review has reviewed this pull request through 8e770a0; a later push is reviewed from there. |
Environment secret names allow only [A-Za-z0-9_], and a called job's environment secret replaces the passed secret of the same name. Rename the workflow_call secrets to STANDARDS_SYNC_APP_CLIENT_ID and STANDARDS_SYNC_APP_PRIVATE_KEY so the standards-sync environment can supply them once the repo-level secrets are removed. Callers must rename the secrets they pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @kyle-sexton's task in 50s —— View job Security review — PR #707 (incremental, through
|
|
Claude finished @kyle-sexton's task in 1m 18s —— View job Code review complete
No code-review findings. This incremental commit ( Checked:
Not independently verified: no permission to run Branch: |
No related issue: fleet repin to ci-workflows v0.39.0 in the GitHub Actions conventions migration (standards-sync automation, phase C). ## Summary Moves this repository's repo-owned ci-workflows pins from v0.38.2 (`cf316d1`) to v0.39.0 (`6ba73b97b058602c4dd2bb6e2cce234d11011787`), and renames the secrets this repository passes to `maintenance-sync-standards` to the names v0.39.0 declares. ## Fix - Pin SHA and `# v0.39.0` comment on 31 lines across five workflows. - `maintenance-sync-standards.yml`: `app-client-id` / `app-private-key` become `STANDARDS_SYNC_APP_CLIENT_ID` / `STANDARDS_SYNC_APP_PRIVATE_KEY` (values unchanged). Environment secret names allow only `[A-Za-z0-9_]`, so the hyphenated names could never be supplied from an environment. No `environment` input is passed: the default `standards-sync` is intended, and its main-only branch policy is declared in github-iac separately. Until then the job auto-creates the environment and still reads the repo-level secrets. - Component sources under `components/` are untouched; managed callers move through `maintenance-repin-ci-workflows`. ## Verification - actionlint passes on `.github/workflows/*.yml`; every pinned path exists at `6ba73b9`. - Runner-policy contracts for `6ba73b9`, including the renamed secret keys, are in #732; this PR's runner-policy check passes once #732 merges. ## Related - #732 (v0.39.0 runner-policy contracts) - melodic-software/ci-workflows#707 (environment input, secret rename), #708 (sync-verify mode); release v0.39.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
No related issue: prep for deleting the repository-level
`STANDARDS_SYNC_APP_*` secrets now that the sync App key lives in the
main-only `standards-sync` environment.
## Summary
Three workflows still read the repository-level
`STANDARDS_SYNC_APP_CLIENT_ID` / `STANDARDS_SYNC_APP_PRIVATE_KEY`. This
PR moves the two scheduled audits onto the `standards-sync` environment.
The third, `pr-require-checks.yml` job `verify-pr-convention-lockstep`,
is left unchanged and needs an owner decision before the repository
secrets are deleted (see below).
## Fix
**`maintenance-audit-code-review-rules.yml` / `audit`.** The App token
(`contents: read`, `metadata: read`, whole installation) lists
`installation/repositories`, keeps the private ones, and reads each
one's `AGENTS.md`. Those repositories are private, so `GITHUB_TOKEN`
cannot replace it. The job runs only on `schedule` and
`workflow_dispatch`, so it now declares `environment: {name:
standards-sync, deployment: false}`; the environment's secrets of the
same names supply the key, and its `main` branch policy admits these
runs. No deployment record is created.
**`maintenance-audit-link-check-excludes.yml` / `audit`.** The App token
(`metadata: read`, whole installation) reads `installation/repositories`
names and visibility once. That is the installation's repository set,
which `GITHUB_TOKEN` cannot read. Same trigger shape, same change.
In both, the missing-credential warning now names the environment. A
`workflow_dispatch` from a non-main branch is now refused by the
environment's branch policy instead of running.
**`pr-require-checks.yml` / `verify-pr-convention-lockstep`:
unchanged.** The token (`contents: read`, whole installation) is passed
as `LOCKSTEP_GITHUB_TOKEN` to
`components/pr-convention-policy/lockstep-drift.mjs`, which reads gate
files through the contents API in every `CONSUMER_REPOSITORIES` entry.
Five of them are private (`claude-code-proxy`, `dotfiles`, `github-iac`,
`medley`, `provisioning`, checked with `gh api
repos/melodic-software/<r> --jq .private`), so `GITHUB_TOKEN` cannot
read them. The job runs on PR branches, so the main-only environment
cannot serve it either. Once the repository secrets are deleted, the
mint step is skipped, the private fetches fail as `fetch-error`, and the
lane goes red on every PR. The owner needs to choose one of:
- a separate read-only App (`contents: read` only, installed on the gate
callers) whose key stays a repository secret (and a Dependabot secret);
- keep the current repository secrets until such an App exists;
- move the live lockstep check off PRs into a scheduled main-only job in
`standards-sync`, leaving only the hermetic fixture tests on PRs.
## Verification
- `actionlint` on both changed workflows: clean.
- `zizmor --offline` on both: no findings.
- `npm run lint:github-actions-conventions` (enforcing): 0 findings.
- `gh api repos/melodic-software/standards/environments/standards-sync`:
branch policy `main` only; secrets `STANDARDS_SYNC_APP_CLIENT_ID`,
`STANDARDS_SYNC_APP_PRIVATE_KEY` present.
- Not yet run live: a `workflow_dispatch` of each audit on `main` after
merge confirms the environment key mints.
## Related
- melodic-software/ci-workflows#707: the `environment` input on the
sync-standards reusable that moved the App key into `standards-sync`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R
Co-authored-by: Claude Opus 5.5 <[email protected]>

No related issue: part of the standards-sync automation plan agreed with the Automation Lanes session; tracked in its ledger.
Summary
The standards sync App key is a repository secret in standards, so a run on any branch can read it.
This lets the caller keep the key in an environment whose deployment-branch policy allows only main.
Fix
environmentinput onmaintenance-sync-standards.yml, defaultstandards-sync.attestandsyncjobs (the only ones that use the App secrets) declareenvironment: { name: inputs.environment, deployment: false }.Until standards creates the environment and moves the secrets into it, the jobs still resolve the
repo-level secrets, so nothing changes at merge or release.
Verification
node --test .github/scripts/*.test.cjs259/259.github-app, attest owner-scoped token) is pre-existing on main.secrets:;environment.nameacceptsinputs;deployment: falseskips deployment records (docs.github.com, fetched 2026-10-07).(must be refused) before deleting the repo-level secrets.
Related
🤖 Generated with Claude Code