Commit 931eb83
[gh-aw] Eliminate magic GH_AW_* secret references from lock files (#25765)
The dotnet/macios secret-audit report flags every secret name that appears in a compiled agentic workflow, including the "magic" fallback secrets that gh-aw emits as the tail of its token-resolution chains (`GH_AW_GITHUB_TOKEN` and `GH_AW_GITHUB_MCP_SERVER_TOKEN`). Those names showed up in all three `*.lock.yml` files even though we never configure them, because gh-aw bakes the full fallback expression into every safe-output handler, into the GitHub MCP server wiring, and into the checkout "Fetch additional refs" step.
Set explicit `github-token: ${{ secrets.GITHUB_TOKEN }}` overrides so the compiler short-circuits each fallback chain before it references the magic names:
- `tools.github.github-token` → replaces the `GH_AW_GITHUB_MCP_SERVER_TOKEN` → `GH_AW_GITHUB_TOKEN` → `GITHUB_TOKEN` chain used by the GitHub MCP server container.
- `safe-outputs.github-token` → replaces the `GH_AW_GITHUB_TOKEN` → `GITHUB_TOKEN` chain used by the safe-output handlers.
- `checkout.github-token` (code-radiator only) → replaces the `GH_AW_GITHUB_MCP_SERVER_TOKEN` → `GH_AW_GITHUB_TOKEN` → `GITHUB_TOKEN` chain used by the "Fetch additional refs" step that `checkout.fetch: ["*"]` generates. `GITHUB_TOKEN` is sufficient to fetch refs from the same repository, so there is no functional change.
`GH_AW_CI_TRIGGER_TOKEN` is intentionally left in place in code-radiator. Unlike the chains above it is **not** a magic fallback: it is the documented secret gh-aw uses to push an empty commit after `create-pull-request` / `push-to-pull-request-branch` so that CI runs on the auto-created merge PRs (pushes made with `GITHUB_TOKEN` do not trigger workflow runs — a GitHub Actions security feature). Overriding it with `GITHUB_TOKEN` would silently stop CI from triggering on those PRs.
This branch also recompiles all three workflows with the locally installed gh-aw compiler (v0.79.8), which refreshes the generated lock files, the `agentics-maintenance.yml` maintenance workflow, `actions-lock.json`, and the gh-aw dependabot ignore entry.
After recompiling, the `# Secrets used:` block in each lock file lists only secrets that are actually configured:
| Workflow | Secrets |
|----------|---------|
| `ci-postmortem.lock.yml` | `COPILOT_GITHUB_TOKEN`, `GITHUB_TOKEN` |
| `code-radiator.lock.yml` | `COPILOT_GITHUB_TOKEN`, `GH_AW_CI_TRIGGER_TOKEN`, `GITHUB_TOKEN` |
| `macios-reviewer.lock.yml` | `COPILOT_GITHUB_TOKEN`, `GITHUB_TOKEN` |
`gh aw compile` reports 0 errors on all three workflows.
Inspired by dotnet/android#11685 (commit `dbd72dd`).
🤖 Pull request created by Copilot
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ed2342f commit 931eb83
10 files changed
Lines changed: 1226 additions & 286 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | | - | |
31 | | - | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments