[BLOCKED] Use Copilot org billing for the repo's internal agentic workflows instead of a PAT#1733
Conversation
Live test passed ✅Verified before merge via a stacked test PR (#1734, since closed): a Post-merge follow-ups (not in this PR)These only become relevant if the repo later upgrades gh-aw past v0.77.5, which introduces two guards this version predates:
The two hand-rolled workflows ( |
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s 11 gh-aw agentic workflows to authenticate Copilot inference using organization billing via the built-in GITHUB_TOKEN (instead of a user-provided COPILOT_GITHUB_TOKEN PAT), by adding permissions: copilot-requests: write and regenerating the compiled lock workflows accordingly.
Changes:
- Add
permissions: copilot-requests: writeto each of the 11 gh-aw source workflows (.md). - Regenerate each compiled workflow (
*.lock.yml) to drop theCOPILOT_GITHUB_TOKENsecret/validation wiring and instead useCOPILOT_GITHUB_TOKEN: ${{ github.token }}plusS2STOKENS: true. - Update job-level permissions in compiled workflows where explicit permission blocks are present so Copilot requests are allowed.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/sdk-consistency-review.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/sdk-consistency-review.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/release-changelog.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/release-changelog.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/java-codegen-fix.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/java-codegen-fix.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/java-adapt-handwritten-code-to-accept-upgrade-changes.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/java-adapt-handwritten-code-to-accept-upgrade-changes.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/issue-triage.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/issue-triage.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/issue-classification.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/issue-classification.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS, adjust called-job permissions. |
| .github/workflows/handle-question.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/handle-question.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/handle-enhancement.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/handle-enhancement.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/handle-documentation.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/handle-documentation.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/handle-bug.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/handle-bug.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
| .github/workflows/cross-repo-issue-analysis.md | Add copilot-requests: write to enable org-billed Copilot requests. |
| .github/workflows/cross-repo-issue-analysis.lock.yml | Recompiled to stop requiring PAT secret; use github.token + S2STOKENS. |
Copilot's findings
- Files reviewed: 22/22 changed files
- Comments generated: 4
91e6a32 to
a96c8f9
Compare
Scope narrowed after reviewPer discussion, this PR now migrates only the 7 internal, event-triggered workflows and leaves the 4 reusable ( Reason: Re-converted to draft for another look given the narrowed scope. |
|
Warning
Blocked / do not merge — a dispatcher↔handler coupling means this needs a maintainer decision first. See the pinned comment.
What Switches the repo's 7 internal (event-triggered) gh-aw agentic workflows from a user-supplied
COPILOT_GITHUB_TOKENPAT to organization billing, so the Copilot engine authenticates with the built-inGITHUB_TOKEN. Each affected workflow's frontmatter gainspermissions: copilot-requests: write; recompiling drops theCOPILOT_GITHUB_TOKENsecret (and its validation step) and routes Copilot inference through the org's Copilot tenant. Affected (internal) workflows:sdk-consistency-review,issue-triage,issue-classification,release-changelog,cross-repo-issue-analysis,java-codegen-fix,java-adapt-handwritten-code-to-accept-upgrade-changes. ## Deliberately NOT changed: the reusable workflows The 4 reusable (workflow_call) workflows —handle-bug,handle-question,handle-enhancement,handle-documentation— are intentionally left on the PAT. These are designed to be invoked from other repositories, and a non-org caller repo cannot use org billing (copilot-requests: writehas no org Copilot tenant to bill against) — it genuinely needsCOPILOT_GITHUB_TOKEN. Migrating them would break that cross-repo portability contract and is the maintainers' call, so this PR leaves them untouched. ## Why The repo's own internal workflows depend on aCOPILOT_GITHUB_TOKENPAT that ties CI to one person's account/entitlement, requires managing a secret, and attributes inference to the PAT owner rather than the organization. For workflows that only ever run inside this org-owned repo, gh-aw'scopilot-requests: writepath uses the Actions token billed centrally to the org, removing the PAT. (github/copilot-agent-runtimeadopted this — see github/copilot-agent-runtime#10632 / #10729.) ## Verified before merge A live test (stacked PR, since closed) confirmedsdk-consistency-reviewruns the org-billing lock successfully: theagentjob authenticated via the built-inGITHUB_TOKEN(no PAT in scope, no validate-secret step), proving org billing is enabled for this repo. ## How the diff was kept minimal Recompiled with this repo's existing gh-aw compiler version (v0.77.5), so action pins/structure are unchanged — a no-op recompile produced zero diff. The only edits are+1 lineper.mdplus the mechanical lock changesgh aw compilegenerates for the auth swap. ## Prerequisite Org policy must allow Copilot-CLI org billing for this repo (Org → Settings → Copilot → Policies → Copilot CLI). The live test confirmed it is currently enabled. ## Follow-ups (not in this PR) - The 2 hand-rolled workflows (java-codegen-check.yml,java-smoke-test.yml) still use the PAT. - If the repo later upgrades gh-aw past v0.77.5 (gaining the daily-AIC guardrail + confused-deputy bot guard), consider settingGH_AW_DEFAULT_MAX_DAILY_AI_CREDITS(≈50,000, based on measured volume) andbots: ["dependabot"].