Skip to content

feat: implement issue #1327 — Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine) - #1328

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-1327-20260719-2119
Jul 20, 2026
Merged

feat: implement issue #1327 — Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine)#1328
don-petry merged 3 commits into
mainfrom
dev-lead/issue-1327-20260719-2119

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #1327

Implemented by dev-lead agent. Please review.

…PAT_DON_PETRY (single don-petry PAT for the Copilot engine)
@don-petry
don-petry requested a review from a team as a code owner July 19, 2026 21:24
Copilot AI review requested due to automatic review settings July 19, 2026 21:24
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a736490-1d71-4552-9dbc-200f6c1d7f8d

📥 Commits

Reviewing files that changed from the base of the PR and between a122ee5 and e243055.

📒 Files selected for processing (7)
  • .github/workflows/dev-lead-reusable.yml
  • .github/workflows/gh-aw-cross-org.yml
  • .github/workflows/pr-review.yml
  • .github/workflows/readme-refresh.yml
  • AGENTS.md
  • docs/dev-lead/spec.md
  • docs/pr-review-agent/machine-user-setup.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-1327-20260719-2119

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request retires the separate GH_PAT_DON_PETRY_COPILOT secret, consolidating Copilot authentication under the single GH_PAT_DON_PETRY PAT across documentation and workflow specifications. Feedback on the changes suggests adding a fallback to GH_PAT_WORKFLOWS for COPILOT_GITHUB_TOKEN in docs/dev-lead/spec.md to prevent potential breakages during the active migration transition.

Comment thread docs/dev-lead/spec.md
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 19, 2026 21:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements issue #1327 by standardizing Copilot engine authentication across this repo’s GitHub Actions workflows to use the single GH_PAT_DON_PETRY secret (and removing the deprecated _COPILOT/GH_PAT secret plumbing from reusable workflow interfaces), while updating docs to match the new token model.

Changes:

  • Repointed all Copilot auth paths (COPILOT_GITHUB_TOKEN, and relevant GH_TOKEN cases) to ${{ secrets.GH_PAT_DON_PETRY }} (preserving the || secrets.GITHUB_TOKEN degradation leg where required).
  • Removed now-dead reusable workflow_call.secrets declarations for GH_PAT_DON_PETRY_COPILOT and deprecated GH_PAT alias (in dev-lead-reusable.yml and pr-review.yml).
  • Updated documentation to reflect that Copilot access is an account entitlement and no separate Copilot PAT secret is needed.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/pr-review-agent/machine-user-setup.md Updates secret naming guidance and migration notes to retire GH_PAT_DON_PETRY_COPILOT in favor of GH_PAT_DON_PETRY.
docs/dev-lead/spec.md Updates the COPILOT_GITHUB_TOKEN example to use secrets.GH_PAT_DON_PETRY.
AGENTS.md Removes GH_PAT_DON_PETRY_COPILOT from the PAT secret naming examples to match the single-token model.
.github/workflows/readme-refresh.yml Switches GH_TOKEN to secrets.GH_PAT_DON_PETRY for the README refresh automation.
.github/workflows/pr-review.yml Repoints COPILOT_GITHUB_TOKEN to secrets.GH_PAT_DON_PETRY and removes obsolete reusable secret declarations.
.github/workflows/gh-aw-cross-org.yml Repoints COPILOT_GITHUB_TOKEN and updates the engine-install GH_TOKEN to `secrets.GH_PAT_DON_PETRY
.github/workflows/dev-lead-reusable.yml Repoints all Copilot token reads and the preflight GH_PAT passthrough to secrets.GH_PAT_DON_PETRY, and removes obsolete reusable secret declarations.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge July 19, 2026 21:29
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
- Quality Gate passed: no code quality, security, or coverage issues detected
Files changed: (no fixes required)
Skipped (informational): 1
- Gemini suggestion about GH_PAT_WORKFLOWS fallback: intentional design per issue #1327 (consolidate to single PAT)
```

@don-petry
don-petry enabled auto-merge (squash) July 19, 2026 21:30
@donpetry-bot

donpetry-bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor
Superseded by automated re-review at e2430557e6dd3cec2bf6d7e9f864af903f26497b — click to expand prior review.

Review — fix requested (cycle 1/3)

The automated review identified the following issues. Please address each one:

Findings to fix

Automated review — NEEDS HUMAN REVIEW

Risk: MEDIUM
Reviewed commit: a5ac837c07a1ec084326bbc8218257c85798ce90
Cascade: triage → audit (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)

Summary

The core token consolidation is sound: issue #1327 documents that GH_PAT / GH_PAT_DON_PETRY_COPILOT and GH_PAT_DON_PETRY hold the same underlying don-petry classic PAT and the Copilot engine already ran on it via the || fallback, so there is no new privilege exposure and the Gemini fallback suggestion was correctly dispositioned as intentional. However, the PR violates its own explicit safety gate: TalkTerm/.github/workflows/pr-review.yml (lines 85-91) passes COPILOT_GITHUB_TOKEN and GH_PAT to the reusable pr-review.yml by name rather than via secrets: inherit, and this PR deletes both workflow_call.secrets declarations - once promoted to the pr-review/stable channel, TalkTerm's PR-review automation hard-fails at workflow validation ('invalid secrets'), silently disabling a review security control in that repo. Escalating for a targeted fix: retain the COPILOT_GITHUB_TOKEN and GH_PAT declarations in pr-review.yml's workflow_call.secrets (harmless if unused, exactly as the issue's safety gate prescribes) or migrate the TalkTerm caller to secrets: inherit before this change reaches any channel TalkTerm pins.

Downstream impact

This change is consumed by 8 downstream repo(s) that pin the affected reusable workflow / lib / prompt. Impacted consumers:

Impacted shared surfaces:
  - .github/workflows/dev-lead-reusable.yml
  - .github/workflows/pr-review.yml

Impacted consumers (8, fetching up to 10):
  - petry-projects/.github (pins .github/workflows/dev-lead-reusable.yml)
      .github/workflows/dev-lead.yml
  - petry-projects/.github-private (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
      .github/workflows/dev-lead.yml
      .github/workflows/pr-review-canary.yml
      .github/workflows/pr-review-trigger.yml
      .github/workflows/test-dev-lead.yml
  - petry-projects/ContentTwin (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
      .github/workflows/dev-lead.yml
      .github/workflows/pr-review.yml
  - petry-projects/TalkTerm (pins .github/workflows/dev-lead-reusable.yml)
      .github/workflows/dev-lead.yml
  - petry-projects/bmad-bgreat-suite (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
      .github/workflows/dev-lead.yml
      .github/workflows/pr-review.yml
  - petry-projects/broodly (pins .github/workflows/dev-lead-reusable.yml)
      .github/workflows/dev-lead.yml
  - petry-projects/google-app-scripts (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
      .github/workflows/dev-lead.yml
      .github/workflows/pr-review.yml
  - petry-projects/markets (pins .github/workflows/dev-lead-reusable.yml,.github/workflows/pr-review.yml)
      .github/workflows/dev-lead.yml
      .github/workflows/pr-review.yml

Findings

  • MAJOR: Safety gate in issue Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine) #1327 violated: the gate required removing the GH_PAT_DON_PETRY_COPILOT/GH_PAT (and formerly COPILOT_GITHUB_TOKEN) workflow_call.secrets declarations ONLY if no caller passes them by name. TalkTerm/.github/workflows/pr-review.yml lines 85-91 explicitly passes 'COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}' and 'GH_PAT: ${{ secrets.GH_PAT }}' to pr-review.yml@pr-review/stable. GitHub Actions rejects secrets passed to a reusable workflow that does not declare them, so the caller run hard-fails at validation once this change is promoted to pr-review/stable - breaking TalkTerm's PR review automation (a security control). Note the deep review's assumption that this is a soft 'unused secret' condition is incorrect. Fix: re-add COPILOT_GITHUB_TOKEN and GH_PAT declarations to pr-review.yml workflow_call.secrets (per the gate: 'leave the declaration in place, harmless, unused'), or update the TalkTerm caller to secrets: inherit before channel promotion.
  • MINOR: Even if declarations were retained, TalkTerm's explicit-secrets caller never passes GH_PAT_DON_PETRY, so COPILOT_GITHUB_TOKEN resolves empty there under the new plumbing and the Copilot review engine cannot authenticate in that repo. The other 7 consumers use secrets: inherit and are unaffected. Coordinate the TalkTerm caller migration with this change.
  • INFO: Deep review's privilege-scope-increase concern is resolved as an explicitly accepted trade-off: per issue Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine) #1327 there is only one don-petry PAT in practice (GH_PAT and GH_PAT_DON_PETRY hold the same classic repo+workflow token), the Copilot engine has already been running on it via the || secrets.GH_PAT fallback, and independent rotation of a dedicated Copilot token is knowingly given up (one-line revert documented if ever re-split). Residual: the same-value assertion is the owner's claim and not verifiable from CI; acceptable given the documented rationale.
  • INFO: Gemini's suggestion to add a || secrets.GH_PAT_WORKFLOWS fallback for COPILOT_GITHUB_TOKEN was correctly dispositioned as no-changes: issue Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine) #1327 explicitly forbids re-adding fallbacks for the Copilot path and scopes GH_PAT_WORKFLOWS migration work to chore(secrets): retire GH_PAT_WORKFLOWS + GH_PAT after don-petry PAT cutover (manual/gated cleanup) #1326; the flagged line is a docs example. Not a blocker.
  • INFO: Thin caller stubs in this and consumer repos still carry the header comment 'OPTIONAL secrets: GH_PAT_WORKFLOWS, GOOGLE_API_KEY, GH_PAT' (e.g. dev-lead.yml line 16), now stale after GH_PAT retirement. Cosmetic; stubs are freeze-protected, so fold into the next stub-template refresh rather than this PR. All 48 CI checks (gitleaks, CodeQL, AgentShield, SonarCloud, actionlint) pass; no secret material in the diff; acceptance-criteria grep returns zero workflow hits at head a5ac837.

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.

Additional tasks

  1. Resolve all unresolved review thread comments from other reviewers
  2. Ensure all CI checks pass after your changes
  3. Rebase on the target branch if behind
  4. Do NOT modify files unrelated to the findings above

The review cascade will automatically re-review after new commits are pushed.

…#1327)

The collapse removed pr-review.yml's COPILOT_GITHUB_TOKEN/GH_PAT
workflow_call.secrets declarations. TalkTerm/.github/workflows/pr-review.yml
calls this reusable @pr-review/stable and passes those secrets BY NAME (not
secrets: inherit), so once promoted to the channel it hard-fails validation —
silently disabling TalkTerm's PR-review control. Caught by the pr-review
cascade (MAJOR).

Verified fleet-wide: every dev-lead caller and 6/7 pr-review callers use
`secrets: inherit`; only TalkTerm's pr-review caller is by-name. So this fix is
scoped to pr-review.yml only (dev-lead-reusable.yml / gh-aw-cross-org.yml /
readme-refresh.yml are safe as-is under inherit/standalone).

- Restore COPILOT_GITHUB_TOKEN and GH_PAT as optional workflow_call.secrets.
- Resolve COPILOT_GITHUB_TOKEN as
  `GH_PAT_DON_PETRY || COPILOT_GITHUB_TOKEN || GH_PAT`: inherit callers get the
  collapse; by-name callers (TalkTerm) keep working. Zero regression.
- Correct machine-user-setup.md: GH_PAT is retained as a transitional by-name
  fallback (not yet retired) until TalkTerm migrates to `secrets: inherit`.

Full removal + GH_PAT deletion is deferred to the caller-migration follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: e2430557e6dd3cec2bf6d7e9f864af903f26497b
Review mode: triage-approved (single reviewer)

Summary

Re-review after the prior cascade's fix-requested cycle. The fix commit resolves the sole MAJOR blocker exactly as prescribed: pr-review.yml restores COPILOT_GITHUB_TOKEN and GH_PAT as optional workflow_call.secrets declarations (honoring issue #1327's safety gate for TalkTerm's by-name caller) and resolves the Copilot token as GH_PAT_DON_PETRY || COPILOT_GITHUB_TOKEN || GH_PAT, so inherit callers get the collapse while TalkTerm keeps working. The prior MINOR (TalkTerm's token resolving empty) is closed by the same fallback chain. The consolidation itself introduces no new privilege exposure — the Copilot engine was already running on the same don-petry classic PAT via the || secrets.GH_PAT fallback — and no secret material appears in the diff. Docs (machine-user-setup.md, spec.md, AGENTS.md) updated to match.

Linked issue analysis

Closes #1327 (Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY). All three scope items are substantively addressed: (1) every Copilot token path repointed to secrets.GH_PAT_DON_PETRY, preserving the || secrets.GITHUB_TOKEN leg in gh-aw-cross-org.yml and adding no GH_PAT fallback outside pr-review.yml; (2) dead declarations removed from dev-lead-reusable.yml (all dev-lead callers verified on secrets: inherit), while pr-review.yml retains them per the issue's explicit safety gate because TalkTerm passes them by name; (3) docs updated. Out-of-scope items (#1326 secret deletion) correctly untouched.

Findings

  • RESOLVED (was MAJOR): pr-review.yml workflow_call.secrets declarations for COPILOT_GITHUB_TOKEN/GH_PAT restored; TalkTerm's by-name caller will pass validation once promoted to pr-review/stable.
  • RESOLVED (was MINOR): COPILOT_GITHUB_TOKEN now falls back to the by-name secrets, so TalkTerm's Copilot engine keeps authenticating until it migrates to secrets: inherit.
  • INFO (carried, non-blocking): same-value assertion for GH_PAT vs GH_PAT_DON_PETRY remains the owner's claim, accepted per issue #1327; stale stub header comments deferred to the next freeze-protected stub-template refresh.
  • No new issues introduced by the fix commit (scoped to pr-review.yml + machine-user-setup.md). The single gemini-code-assist review thread is resolved. Secret-scan MCP tool unavailable in this run; gitleaks CI check passed.

CI status

All checks green at e243055: Lint, actionlint, ShellCheck, CodeQL (actions+python), gitleaks secret scan, AgentShield, SonarCloud quality gate, caller-stub-freeze, validate-caller-inputs, caller-permissions, verify-persona-identity, gh-aw-compile, unit tests/bats. Dependabot/audit jobs skipped (not applicable).


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 298a1d2 into main Jul 20, 2026
83 of 91 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1327-20260719-2119 branch July 20, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapse GH_PAT_DON_PETRY_COPILOT → GH_PAT_DON_PETRY (single don-petry PAT for the Copilot engine)

3 participants