feat: implement issue #1338 — Migrate listener-template GH_PAT_WORKFLOWS refs to GH_PAT_DON_PETRY fallback (#1326 prereq) - #1339
Conversation
…OWS refs to GH_PAT_DON_PETRY fallback (#1326 prereq)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-07-20T19:34:32Z. |
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s listener workflow templates (used for downstream bootstraps) to prefer the canonical org PAT secret GH_PAT_DON_PETRY while retaining GH_PAT_WORKFLOWS as a fallback, as part of the #1326 retirement path (tracked in #1338). It also updates related documentation examples so the intended token-resolution pattern is consistent.
Changes:
- Updated both listener templates to use
${{ secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWS }}whereverGH_PAT_WORKFLOWSwas referenced bare. - Updated documentation examples to reflect the expanded fallback chain including
github.tokenwhere applicable. - Kept
docs/pr-review-agent/machine-user-setup.mdunchanged (still documenting the transitional fallback), matching the stated scope.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| templates/mention-listener.yml | Replaces bare secrets.GH_PAT_WORKFLOWS with `secrets.GH_PAT_DON_PETRY |
| templates/gh-aw-org-listener.yml | Applies the same canonical-first fallback pattern for GH_TOKEN across issue-triage and CI-failure dispatch steps. |
| docs/dev-lead/implementation-plan.md | Updates example token/GH_TOKEN expressions to include secrets.GH_PAT_DON_PETRY ahead of secrets.GH_PAT_WORKFLOWS (and github.token where shown). |
| docs/aw/dependency-advisory.md | Updates the configuration table to document the preferred secret fallback order for GH_TOKEN. |
There was a problem hiding this comment.
Code Review
This pull request updates workflow templates and documentation to include secrets.GH_PAT_DON_PETRY as an alternative token for GH_TOKEN. Feedback was provided regarding the limitations of fine-grained Personal Access Tokens (PATs) in multi-organization workflows, recommending classic PATs or GitHub App installation tokens if the workflow needs to span multiple organizations.
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Review — fix requested (cycle 1/3)The automated review identified the following issues. Please address each one: Findings to fixAutomated review — NEEDS HUMAN REVIEWRisk: MEDIUM SummaryCode-level audit found the diff safe: a mechanical, scope-exact migration of 8 bare GH_PAT_WORKFLOWS references in two listener templates to a GH_PAT_DON_PETRY-first fallback chain, plus 3 matching doc lines, precisely as specified in issue #1338. No secret values, no new injection surface, behavior identical until the new secret is provisioned, and the org-member trust gate verifiably fails closed on token error (gh api failure yields trusted=false), so misconfiguration degrades to availability loss, not a trust bypass; the mention-listener trust decision uses event-payload author_association and is token-independent. Escalating anyway: the changed tokens gate cross-org dispatch in org-wide bootstrap templates, and correct rollout depends on GH_PAT_DON_PETRY being a classic PAT with read:org and no broader scope than the token it replaces — the org secrets API returns 403 at this tier, so only a human org admin can confirm provisioning before merge. Findings
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
The review cascade will automatically re-review after new commits are pushed. |



Closes #1338
Implemented by dev-lead agent. Please review.