[gh-aw] Eliminate magic GH_AW_* secret references from lock files#25765
Merged
Conversation
…ken chain
The secret-audit report flags every secret name that appears in the
compiled lock file, including the "magic" fallback secrets gh-aw emits as
the tail of its token-resolution chains (GH_AW_GITHUB_MCP_SERVER_TOKEN and
GH_AW_GITHUB_TOKEN). These leaked into code-radiator.lock.yml via the
"Fetch additional refs" step generated by `checkout.fetch: ["*"]`, whose
token defaults to the full magic fallback chain.
Set an explicit `checkout.github-token: ${{ secrets.GITHUB_TOKEN }}` so the
compiler short-circuits that chain. GITHUB_TOKEN is sufficient to fetch
refs from the same repository, so there is no functional change.
After recompiling, the `# Secrets used:` block lists only COPILOT_GITHUB_TOKEN,
GH_AW_CI_TRIGGER_TOKEN and GITHUB_TOKEN.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s gh-aw (GitHub Agentic Workflows) configurations to prevent “magic” GH_AW_* secret names from being embedded in compiled *.lock.yml workflows by explicitly setting github-token: ${{ secrets.GITHUB_TOKEN }} in workflow frontmatter, and then recompiling the lock files with a newer gh-aw compiler.
Changes:
- Add explicit
github-tokenoverrides in the gh-aw frontmatter fortools.github,safe-outputs, andcheckout(where used) to short-circuit gh-aw’s token fallback chains. - Recompile the affected workflows’
*.lock.ymloutputs (and refresh generated maintenance/lock artifacts) using gh-aw v0.79.8. - Update Dependabot ignore configuration for gh-aw-actions entries.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/macios-reviewer.md | Adds explicit github-token overrides for GitHub tool + safe-outputs. |
| .github/workflows/macios-reviewer.lock.yml | Recompiled lock workflow; removes GH_AW_* secret fallback references and updates generated content to gh-aw v0.79.8. |
| .github/workflows/code-radiator.md | Adds explicit github-token overrides for GitHub tool + checkout + safe-outputs. |
| .github/workflows/code-radiator.lock.yml | Recompiled lock workflow; removes GH_AW_* secret fallback references and updates generated content to gh-aw v0.79.8. |
| .github/workflows/ci-postmortem.md | Adds explicit github-token overrides for GitHub tool + safe-outputs. |
| .github/workflows/ci-postmortem.lock.yml | Recompiled lock workflow; removes GH_AW_* secret fallback references and updates generated content to gh-aw v0.79.8. |
| .github/workflows/agentics-maintenance.yml | Adds the generated gh-aw maintenance workflow (v0.79.8). |
| .github/dependabot.yml | Adjusts ignore entries for gh-aw-actions dependencies. |
| .github/aw/actions-lock.json | Updates gh-aw-actions entries (but see review comment about remaining drift). |
.github/workflows/agentics-maintenance.yml is auto-generated by the gh-aw compiler (marked "DO NOT EDIT"), so any zizmor findings against it are not actionable. Exclude it from the zizmor file discovery the same way the generated *.lock.yml files are already excluded. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dalexsoto
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_TOKENandGH_AW_GITHUB_MCP_SERVER_TOKEN). Those names showed up in all three*.lock.ymlfiles 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 theGH_AW_GITHUB_MCP_SERVER_TOKEN→GH_AW_GITHUB_TOKEN→GITHUB_TOKENchain used by the GitHub MCP server container.safe-outputs.github-token→ replaces theGH_AW_GITHUB_TOKEN→GITHUB_TOKENchain used by the safe-output handlers.checkout.github-token(code-radiator only) → replaces theGH_AW_GITHUB_MCP_SERVER_TOKEN→GH_AW_GITHUB_TOKEN→GITHUB_TOKENchain used by the "Fetch additional refs" step thatcheckout.fetch: ["*"]generates.GITHUB_TOKENis sufficient to fetch refs from the same repository, so there is no functional change.GH_AW_CI_TRIGGER_TOKENis 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 aftercreate-pull-request/push-to-pull-request-branchso that CI runs on the auto-created merge PRs (pushes made withGITHUB_TOKENdo not trigger workflow runs — a GitHub Actions security feature). Overriding it withGITHUB_TOKENwould 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.ymlmaintenance 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:ci-postmortem.lock.ymlCOPILOT_GITHUB_TOKEN,GITHUB_TOKENcode-radiator.lock.ymlCOPILOT_GITHUB_TOKEN,GH_AW_CI_TRIGGER_TOKEN,GITHUB_TOKENmacios-reviewer.lock.ymlCOPILOT_GITHUB_TOKEN,GITHUB_TOKENgh aw compilereports 0 errors on all three workflows.Inspired by dotnet/android#11685 (commit
dbd72dd).🤖 Pull request created by Copilot