Add github-token-for-extra-empty-commit: none to keep GH_AW_CI_TRIGGER_TOKEN out of compiled workflows - #62416
Conversation
…-extra-empty-commit: none Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
github-token-for-extra-empty-commit: none to keep GH_AW_CI_TRIGGER_TOKEN out of compiled workflows
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The opt-out can be bypassed by safe-outputs.env, and the documentation and release classification need correction.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Adds an explicit opt-out for CI-triggering empty commits and removes the unused token reference from compiled workflows.
Changes:
- Adds case-insensitive
noneandapphandling. - Updates schemas, reference documentation, and release notes.
- Tests token omission for both PR safe outputs.
| File | Description |
|---|---|
pkg/workflow/push_to_pull_request_branch.go |
Documents the none option. |
pkg/workflow/create_pull_request.go |
Documents the none option. |
pkg/workflow/create_pull_request_ci_trigger_token_test.go |
Tests token omission. |
pkg/workflow/compiler_safe_outputs_steps.go |
Implements sentinel handling. |
pkg/parser/schemas/main_workflow_schema.json |
Updates schema descriptions. |
docs/src/content/docs/reference/triggering-ci.mdx |
Documents disabling empty commits. |
docs/src/content/docs/reference/frontmatter-full.md |
Updates generated reference text. |
.changeset/ci-trigger-token-none.md |
Records the release change. |
| case "none": | ||
| // Explicitly opt out of the extra empty commit: no token env var is emitted, so the | ||
| // magic GH_AW_CI_TRIGGER_TOKEN secret is absent from both the compiled step and the | ||
| // gh-aw-manifest. The handler skips the empty commit at runtime. |
| github-token-for-extra-empty-commit: none | ||
| ``` | ||
|
|
||
| With `none`, no `GH_AW_CI_TRIGGER_TOKEN` environment variable is emitted and CI checks will not be triggered on the created or updated pull request branch. |
|
|
Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"See Network Configuration for more information.
|
🏗️ ADR required — draft added for PR #62416ResultA draft ADR has been added to this PR because ADR enforcement is required and no existing ADR was found in the PR body or Evidence used
Draft ADR added
Next action for the authorPlease review and refine the draft ADR, especially the trade-offs and decision wording, before merging this PR.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, and /codebase-design (triage: bug_fix / feature-opt-out). Requesting changes: one real correctness gap plus two smaller doc/changeset fixes already flagged by the earlier Copilot review, which I concur with.
📋 Key Themes & Highlights
Key Themes
- Correctness gap (highest impact):
addCITriggerTokenEnvVar'snonecase only suppresses the compiler-generatedGH_AW_CI_TRIGGER_TOKENline.addSafeOutputCoreEnvVarsruns first in the sameenv:block and independently emits anysafe-outputs.enventries verbatim, so a workflow with bothgithub-token-for-extra-empty-commit: noneandsafe-outputs.env.GH_AW_CI_TRIGGER_TOKEN: <secret>would still leak the secret reference into the lock file — the exact outcome this PR exists to prevent. No test covers this combination. - Changeset semver: marked
patch, but this adds a new, backward-compatible public config value/behavior (none), which per.github/skills/developer-release/SKILL.mdshould beminor. - Docs overstatement: the new "Disabling the extra empty commit" section says CI "will not be triggered" with
none, but the fullgithub-tokenoverride documented right below it triggers CI via the primary push regardless of this setting — worth a caveat.
Positive Highlights
- ✅ Clean extraction of
addCITriggerTokenEnvVarout ofaddSafeOutputTokenEnvVars, improving single-responsibility and testability (/codebase-design). - ✅ Case-insensitive sentinel matching (
app/none) while preserving original casing for custom token expressions is a thoughtful, low-risk touch. - ✅
TestCITriggerTokenNoneOmitsSecretis solid TDD coverage for the primary scenarios (create-pull-request, push-to-pull-request-branch, mixed-caseNone), verifying both the lock file body and thegh-aw-manifestsecrets list. - ✅ Confirmed no lock-file diffs across 299 existing workflows — good regression discipline for a compiler change.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 88.8 AIC · ⌖ 14.8 AIC · ⊞ 10.1K
Comment /matt to run again
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "gh-aw": patch | |||
There was a problem hiding this comment.
[/codebase-design] Agreeing with the existing Copilot review comment: this changeset is marked patch, but per the repo's own release guidance (.github/skills/developer-release/SKILL.md), a new backward-compatible option like github-token-for-extra-empty-commit: none is a feature and should be minor.
💡 Suggested fix
---
-"gh-aw": patch
+"gh-aw": minor
---@copilot please address this.
There was a problem hiding this comment.
Updated the changeset to minor in 6e44b32.
| github-token-for-extra-empty-commit: none | ||
| ``` | ||
|
|
||
| With `none`, no `GH_AW_CI_TRIGGER_TOKEN` environment variable is emitted and CI checks will not be triggered on the created or updated pull request branch. |
There was a problem hiding this comment.
[/grill-with-docs] Agreeing with the existing Copilot review comment: "CI checks will not be triggered on the created or updated pull request branch" is too absolute — it's only true when github-token (full override) isn't also set, since that path pushes directly with a real token and triggers CI regardless of this empty-commit setting.
💡 Suggested rewording
Something like: "With none, no GH_AW_CI_TRIGGER_TOKEN environment variable is emitted, so the extra empty commit used to trigger CI is skipped (unless the full github-token override below is also configured, in which case the primary push already triggers CI)."
@copilot please address this.
There was a problem hiding this comment.
Clarified in 6e44b32 that none skips only the extra empty commit; a full github-token override still triggers CI via the primary push.
| case "none": | ||
| // Explicitly opt out of the extra empty commit: no token env var is emitted, so the | ||
| // magic GH_AW_CI_TRIGGER_TOKEN secret is absent from both the compiled step and the | ||
| // gh-aw-manifest. The handler skips the empty commit at runtime. |
There was a problem hiding this comment.
[/diagnosing-bugs] Agreeing with the existing Copilot review comment: none only suppresses the compiler-generated GH_AW_CI_TRIGGER_TOKEN line, but addSafeOutputCoreEnvVars → addCustomSafeOutputEnvVars runs earlier in the same env: block and will still emit a raw safe-outputs.env.GH_AW_CI_TRIGGER_TOKEN: <value> line if a user configures it there, silently reintroducing the exact secret this PR is meant to let repos opt out of.
💡 Suggested fix
Have addCITriggerTokenEnvVar (or addCustomSafeOutputEnvVars) skip/warn on GH_AW_CI_TRIGGER_TOKEN when the sentinel is none, and add a regression test that sets safe-outputs.env.GH_AW_CI_TRIGGER_TOKEN alongside github-token-for-extra-empty-commit: none and asserts the secret is still absent from the lock file.
@copilot please address this.
|
Please address the open review follow-ups below, refresh the branch if needed, and then run the Open review follow-ups (newest first):
I also requested a branch refresh for this PR.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed all directed review follow-ups, refreshed from |
Document the github-token-for-extra-empty-commit: none option (#62416) in safe-outputs-content.md and safe-outputs-management.md, which was missing from both the create-pull-request and push-to-pull-request-branch references. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🎉 This pull request is included in a new release. Release: |


Compiled lock files always reference
GH_AW_CI_TRIGGER_TOKEN— in theProcess Safe Outputsstep env and in thegh-aw-manifestheader — whenevercreate-pull-requestorpush-to-pull-request-branchis configured, even for repositories that deliberately do not define the secret. The reference resolves to an empty string at runtime and the empty commit is skipped, but the lock file still reads as if the token is expected.The issue asks for the token to be dropped automatically when
permissions.copilot-requests: writeis present. That conflates two unrelated tokens:copilot-requests: writeremoves the need for aCOPILOT_GITHUB_TOKENPAT for inference, whileGH_AW_CI_TRIGGER_TOKENis what pushes the extra empty commit that starts CI (GITHUB_TOKENpushes never trigger workflows). 45 workflows in this repo use both, and auto-omission would silently stop CI from triggering on their PRs. This PR adds an explicit opt-out instead.Compiler
addCITriggerTokenEnvVarextracted fromaddSafeOutputTokenEnvVars, with anonecase that emits no env var at all — removing the secret from both the step and the manifest.app/nonesentinels are now matched case-insensitively (trimmed + lowercased) soNone/Appare not treated as literal token values; custom token expressions keep their original casing.Schema & docs
none; generatedfrontmatter-full.mdentries updated to match.triggering-ci.mdx: new "Disabling the extra empty commit" section, plus a note thatGH_AW_CI_TRIGGER_TOKENis unrelated to Copilot inference billing.Tests
TestCITriggerTokenNoneOmitsSecretasserts the token is absent from the lock file body and fromgh-aw-manifestsecrets forcreate-pull-request,push-to-pull-request-branch, and mixed casing.Default behavior is unchanged:
make recompileproduces no diffs across the 299 existing lock files.Note for reviewers: when both PR safe outputs are configured with conflicting values,
create-pull-requeststill wins, matching the existing precedence forapp/custom tokens. Tightening that (or erroring on conflicts) is deliberately left out of scope.