Repository navigation
Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine) #1327
Description
Goal
Collapse the Copilot-engine token onto the single don-petry PAT. Every Copilot auth path currently reads ${{ secrets.GH_PAT_DON_PETRY_COPILOT || secrets.GH_PAT }}; repoint them all to ${{ secrets.GH_PAT_DON_PETRY }} and retire the _COPILOT/GH_PAT plumbing from code.
Why
GH_PAT_DON_PETRY (classic PAT, repo+workflow, account don-petry) already satisfies the Copilot engine: Copilot access is an account-subscription entitlement, not a token scope, and don-petry holds the seat (the review engine has been running on this same token via the || secrets.GH_PAT fallback). There is only one don-petry PAT in practice, so two secrets holding the same value is a manual-sync liability. Independent-rotation of a dedicated Copilot token is intentionally given up; re-splitting later is a one-line revert + one new secret if ever needed.
Scope — all in petry-projects/.github-private
1. Repoint every Copilot token value → ${{ secrets.GH_PAT_DON_PETRY }} (preserve any trailing || secrets.GITHUB_TOKEN graceful-degradation leg; do not add a || secrets.GH_PAT fallback back in — GH_PAT_DON_PETRY is confirmed present org-wide and holds the same token):
.github/workflows/dev-lead-reusable.yml—COPILOT_GITHUB_TOKENat lines ~186, 282, 301, 320, 339, 358, 375, 392, and theGH_PAT:passthrough at line ~226..github/workflows/pr-review.yml—COPILOT_GITHUB_TOKENat line ~147..github/workflows/gh-aw-cross-org.yml—COPILOT_GITHUB_TOKENat line ~48;GH_TOKENat line ~92 (keep its|| secrets.GITHUB_TOKENleg →${{ secrets.GH_PAT_DON_PETRY || secrets.GITHUB_TOKEN }})..github/workflows/readme-refresh.yml—GH_TOKENat line ~68.
2. Remove the now-dead reusable secrets: input declarations for GH_PAT_DON_PETRY_COPILOT and its deprecated GH_PAT alias:
.github/workflows/dev-lead-reusable.ymllines ~38–43.github/workflows/pr-review.ymllines ~49–55
Safety gate: remove these declarations only if no caller passes them by name (verify all consumer stubs use
secrets: inherit; they should). If any caller passesGH_PAT_DON_PETRY_COPILOT/GH_PATexplicitly, leave the declaration in place (harmless, unused) and note it in the PR instead of breaking the caller.
3. Update docs to match:
docs/dev-lead/spec.mdline ~293 —COPILOT_GITHUB_TOKENexample →${{ secrets.GH_PAT_DON_PETRY }}.docs/pr-review-agent/machine-user-setup.md— drop theGH_PAT_DON_PETRY_COPILOTrow (~131) and adjust the migration note (~137): Copilot authenticates with the singleGH_PAT_DON_PETRYclassic PAT; requirement is a Copilot subscription on don-petry, no separate secret.AGENTS.mdline ~319 — update the account-named-secret example that citesGH_PAT_DON_PETRY_COPILOT(cosmetic).
Out of scope (do NOT touch — tracked in #1326)
- Do not delete the
GH_PATrepo secret or theGH_PAT_WORKFLOWSorg secret (manual step, after a green soak). - Do not touch the workflows-token fallbacks
secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWS— separate migration, gated on confirming the first post-cutover dev-lead commit is authored bydon-petry.
Acceptance criteria
git grep -nE "GH_PAT_DON_PETRY_COPILOT|secrets\.GH_PAT\b" -- '.github/workflows/*'returns zero hits on the branch.- Every Copilot auth path resolves to
secrets.GH_PAT_DON_PETRY(with|| secrets.GITHUB_TOKENpreserved where it existed); no|| secrets.GH_PATremains. - Docs updated as above; no stale
GH_PAT_DON_PETRY_COPILOTreferences except intentional historical migration notes. - CI green. Copilot engine authenticates successfully via
GH_PAT_DON_PETRYon a post-merge dev-lead run and a pr-review run.
This is a mechanical token-reference swap (same underlying token value) — no behavior change beyond the secret name resolved.
Activity
don-petry commentedon Jul 19, 2026
Dev-Lead Implementation Plan
Issue: #1327 — Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine)
Scope
Mechanical token-reference swap: repoint every Copilot auth path to
${{ secrets.GH_PAT_DON_PETRY }}, drop the now-deadGH_PAT_DON_PETRY_COPILOT/GH_PATreusablesecrets:declarations, and update docs — same underlying token value, no behavior change.Implementation Checklist
.github/workflows/dev-lead-reusable.yml— repoint 8COPILOT_GITHUB_TOKENrefs + theGH_PAT:passthrough →secrets.GH_PAT_DON_PETRY; remove theGH_PAT_DON_PETRY_COPILOT/GH_PATsecrets:declarations.github/workflows/pr-review.yml— repointCOPILOT_GITHUB_TOKEN; remove theGH_PAT_DON_PETRY_COPILOT/GH_PATsecrets:declarations.github/workflows/gh-aw-cross-org.yml— repointCOPILOT_GITHUB_TOKEN; repointGH_TOKEN→secrets.GH_PAT_DON_PETRY || secrets.GITHUB_TOKEN(preserve degradation leg).github/workflows/readme-refresh.yml— repointGH_TOKEN→secrets.GH_PAT_DON_PETRYdocs/dev-lead/spec.md— exampleCOPILOT_GITHUB_TOKENdocs/pr-review-agent/machine-user-setup.md— drop theGH_PAT_DON_PETRY_COPILOTrow + adjust migration noteAGENTS.md— update the account-named-secret example (cosmetic)Safety gate (verified)
Both consumer stubs use
secrets: inherit(dev-lead.yml,pr-review-trigger.yml) — no caller passesGH_PAT_DON_PETRY_COPILOT/GH_PATby name, so removing the declarations is safe.Tests to Write
git grepplus the repo lint check.Test Command
bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jul 19, 2026
Dev-Lead: Implementation Complete
Plan Execution
${{ secrets.GH_PAT_DON_PETRY }}(8×COPILOT_GITHUB_TOKEN+ theGH_PAT:preflight passthrough indev-lead-reusable.yml;COPILOT_GITHUB_TOKENinpr-review.yml;COPILOT_GITHUB_TOKEN+GH_TOKENingh-aw-cross-org.yml;GH_TOKENinreadme-refresh.yml)|| secrets.GITHUB_TOKENgraceful-degradation leg ongh-aw-cross-org.ymlGH_TOKEN; added no|| secrets.GH_PATfallback anywhereGH_PAT_DON_PETRY_COPILOT/GH_PATreusablesecrets:declarations indev-lead-reusable.ymlandpr-review.yml(safety gate verified — both consumer stubsdev-lead.ymlandpr-review-trigger.ymlusesecrets: inherit, so no caller passes them by name)docs/dev-lead/spec.md,docs/pr-review-agent/machine-user-setup.md(dropped the Copilot row + rewrote migration note),AGENTS.md(cosmetic example)Test Results
Behavior-preserving config/docs change (same underlying token value) → Phase-2 TDD exception. Verification via acceptance-criteria greps + repo lint:
Files Changed
.github/workflows/dev-lead-reusable.yml: repointed 8COPILOT_GITHUB_TOKEN+GH_PAT:passthrough; removed deadsecrets:declarations.github/workflows/pr-review.yml: repointedCOPILOT_GITHUB_TOKEN; removed deadsecrets:declarations.github/workflows/gh-aw-cross-org.yml: repointedCOPILOT_GITHUB_TOKEN+GH_TOKEN(kept|| secrets.GITHUB_TOKEN).github/workflows/readme-refresh.yml: repointedGH_TOKENdocs/dev-lead/spec.md: exampleCOPILOT_GITHUB_TOKENdocs/pr-review-agent/machine-user-setup.md: dropped Copilot secret row, folded Copilot access into theGH_PAT_DON_PETRYrow, rewrote migration noteAGENTS.md: dropped theGH_PAT_DON_PETRY_COPILOTexample (cosmetic)Notes
GH_PAT_DON_PETRY_COPILOTreference is the intentional historical migration note inmachine-user-setup.md, explicitly permitted by the acceptance criteria.secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWSworkflows-token fallbacks (chore(secrets): retire GH_PAT_WORKFLOWS + GH_PAT after don-petry PAT cutover (manual/gated cleanup) #1326), and theGH_PATrepo /GH_PAT_WORKFLOWSorg secrets (manual deletion after soak).GH_PAT_DON_PETRYon a post-merge run" acceptance item is verifiable only post-merge.fix(pr-review): retain by-name Copilot secret declarations + fallback (…
don-petry commentedon Jul 20, 2026
Scope correction (hand-fixed on PR #1328).
The pr-review cascade caught a real MAJOR defect in the initial implementation: removing the
workflow_call.secretsdeclarations frompr-review.ymlbreaks callers that pass those secrets by name rather than viasecrets: inherit.Fleet audit (this session):
secrets: inherit(safe; dev-lead's cleansecrets.GH_PAT_DON_PETRYchange stands fordev-lead-reusable.yml,gh-aw-cross-org.yml,readme-refresh.yml).TalkTerm/.github/workflows/pr-review.ymlpassesCOPILOT_GITHUB_TOKEN+GH_PATby name → would hard-fail validation on channel promotion.Applied fix (commit e243055,
dev-lead:hands-off): scoped topr-review.ymlonly —COPILOT_GITHUB_TOKEN+GH_PATas optionalworkflow_call.secrets.COPILOT_GITHUB_TOKEN: ${{ secrets.GH_PAT_DON_PETRY || secrets.COPILOT_GITHUB_TOKEN || secrets.GH_PAT }}— inherit callers get the collapse, TalkTerm keeps working. Zero regression.Revised acceptance: the original "
git grep GH_PAT_DON_PETRY_COPILOT|secrets.GH_PATreturns zero in workflows" no longer holds —pr-review.ymlintentionally keeps the by-name fallback until TalkTerm migrates tosecrets: inherit(follow-up TalkTerm#…). Full removal of the fallback + declarations, and deletion of theGH_PATsecret, is gated on that migration (tracked with #1326).feat: implement issue #1327 — Collapse GH_PAT_DON_PETRY_COPILOT → GH_…