Skip to content

fix: support fine-grained tokens in pr-review scope validation - #443

Merged
don-petry merged 6 commits into
mainfrom
fix/pr-review-fine-grained-token-support
Jun 6, 2026
Merged

fix: support fine-grained tokens in pr-review scope validation#443
don-petry merged 6 commits into
mainfrom
fix/pr-review-fine-grained-token-support

Conversation

@don-petry

@don-petry don-petry commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix auth scope validation to support fine-grained GitHub tokens alongside classic PATs.

Problem

PR #353 added strict auth scope validation requiring the repo scope (full repository control), which breaks workflows using fine-grained tokens with minimal permissions.

Solution

  • Updated validation to accept either classic PAT (repo scope) or fine-grained tokens (contents:read + pull_requests:write)
  • Document required scopes for both token types
  • Recommend fine-grained tokens for better security (principle of least privilege)

Changes

  • .github/workflows/pr-review.yml: Flexible scope validation with clear error messages
  • agents/pr-reviewer.md: Add required scopes documentation
  • docs/pr-review-agent/pr-review-agent.md: Update setup guide with both token options

Ref #435 (note: original Closes #435 was an erroneous keyword — #435 is an unrelated PR and has been reopened)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Improved PR Review Agent setup guide with flexible authentication options (fine-grained PAT or classic PAT)
    • Clarified required GitHub token scopes and permissions
  • Chores

    • Enhanced token validation to support multiple authentication methods

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 6, 2026 13:46
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 44 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9760a574-403b-4cf8-bd18-122a6571bba4

📥 Commits

Reviewing files that changed from the base of the PR and between 56171b2 and da8fe6a.

📒 Files selected for processing (4)
  • .github/workflows/pr-review.yml
  • agents/pr-reviewer.md
  • docs/pr-review-agent/pr-review-agent.md
  • scripts/post-pr-review.sh
📝 Walkthrough

Walkthrough

This PR updates the PR Review Agent's GitHub token authentication to support fine-grained personal access tokens (PATs) as the recommended approach while maintaining backward compatibility with classic PATs. The workflow validation, agent requirements documentation, and setup guide are all revised to reflect the new token scope requirements and options.

Changes

Fine-grained token scope validation and setup documentation

Layer / File(s) Summary
Workflow auth scope validation
.github/workflows/pr-review.yml
The "Verify auth scopes" step now accepts either a classic PAT containing repo scope or a fine-grained token with both contents and pull_requests scopes, with corresponding error messaging updates.
Token scope requirements documentation
agents/pr-reviewer.md
New section specifies minimum fine-grained token permissions required: repository scopes (contents:read, pull_requests:write, actions:read, metadata:read) and organization scope (members:read); notes that legacy repo scope is not required.
Setup guide and cross-references
docs/pr-review-agent/pr-review-agent.md
PAT setup section restructured as a two-option guide recommending fine-grained PAT creation with explicit permissions alongside a classic PAT fallback; mention-triggered review setup updated to reference the unified PAT setup section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • petry-projects/.github-private#426: Adds workflow-call secrets for passing fine-grained and classic GitHub tokens into pr-review.yml, which directly supports the main PR's updated token scope validation logic.

Suggested labels

needs-human-review

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses issue #435 regarding bot thread handling but the changeset focuses on GitHub token scope validation, which is unrelated to the linked issue's objectives. Verify that this PR is intended to address issue #435 or link it to the appropriate issue (#443 or create a new one for token scope changes).
Out of Scope Changes check ⚠️ Warning All changes relate to supporting fine-grained GitHub tokens in the PR review workflow, which is unrelated to the linked issue #435 about auto-resolving bot threads. This PR should either be linked to the correct issue addressing token scope validation, or the token validation changes should be separated into a different PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: support fine-grained tokens in pr-review scope validation' directly describes the main change: updating scope validation to support fine-grained GitHub tokens.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-review-fine-grained-token-support

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 and usage tips.

@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 updates the documentation to support and recommend fine-grained GitHub Personal Access Tokens (PATs) alongside classic PATs, outlining the specific scopes required. The review feedback highlights two main issues: first, the fine-grained PAT requires contents:write permission rather than contents:read to successfully perform auto-merge and merge operations; second, there is a naming inconsistency between the secret name DON_PETRY_BOT_GH_PAT mentioned in the documentation and GH_PAT_WORKFLOWS used in the workflow templates.

Comment thread agents/pr-reviewer.md Outdated
The agent requires a GitHub personal access token (PAT) with these minimum permissions:

**Repository permissions:**
- `contents:read` — read file contents and diffs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Since the agent is configured to automatically approve and enable auto-merge (or merge) pull requests (as described in the Decision framework), a fine-grained token with only contents:read permission will fail to perform these write operations. To allow the agent to enable auto-merge or merge PRs, the token requires contents:write permission instead of contents:read.

Comment thread docs/pr-review-agent/pr-review-agent.md Outdated
- **Resource owner:** select your organization (e.g. `petry-projects`)
- **Repository access:** All repositories (or specific repos if preferred)
- **Repository permissions:**
- `contents:read` — read files and diffs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

To support enabling auto-merge and merging pull requests, the fine-grained PAT requires write access to repository contents. Please update this to contents:write instead of contents:read.

Comment thread docs/pr-review-agent/pr-review-agent.md Outdated
Comment on lines +304 to +305
(org-level secret or repo secret on `.github`). Use the same PAT created above
in [step 2](#2-create-a-pat-for-the-bot-classic-or-fine-grained).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is an inconsistency between this documentation and the templates/mention-listener.yml workflow template. The template references secrets.GH_PAT_WORKFLOWS (e.g., on lines 36, 57, 71, 84), whereas this step instructs the user to add the secret as DON_PETRY_BOT_GH_PAT. Consider aligning the secret name used in the template or clarifying in the documentation that the secret name in the workflow should match.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

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 updates the PR Review Agent’s authentication guidance and workflow token-scope validation to allow fine-grained PATs (least-privilege) in addition to classic PATs, aligning the automation with modern GitHub token permission models.

Changes:

  • Adjust .github/workflows/pr-review.yml scope validation to accept either classic repo tokens or fine-grained contents + pull_requests permissions.
  • Update the PR reviewer agent profile (agents/pr-reviewer.md) to document fine-grained minimum permissions.
  • Revise the setup guide (docs/pr-review-agent/pr-review-agent.md) to document both classic and fine-grained PAT setup paths.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/pr-review.yml Updates the “Verify auth scopes” step to allow fine-grained tokens (but currently drops a needed classic-token scope check).
agents/pr-reviewer.md Documents required fine-grained token permissions for the agent.
docs/pr-review-agent/pr-review-agent.md Updates setup instructions to include fine-grained PAT option and links back to token creation guidance.

Comment thread .github/workflows/pr-review.yml Outdated
Comment on lines +207 to +222
# Check for required scopes. Accept either:
# - Classic PAT: 'repo' scope (grants full repo access)
# - Fine-grained: 'contents' + 'pull_requests' (minimal permissions)
if grep -qE "(^|[[:space:]])repo([[:space:]]|$)" <<< "$normalized_scopes"; then
# Classic PAT with repo scope — sufficient
:
else
# Fine-grained token — verify minimal scopes
for required_scope in contents pull_requests; do
if ! grep -qE "(^|[[:space:]])${required_scope}([[:space:]]|$)" <<< "$normalized_scopes"; then
echo "::error::GH_TOKEN is missing required scope: ${required_scope}"
echo "::error::Token must have either 'repo' scope (classic) or both 'contents' and 'pull_requests' (fine-grained)"
exit 1
fi
done
fi
Comment on lines +145 to +147
- **Token name:** `pr-review-agent`
- **Expiration:** 90 days (auto-rotate for security)
- **Resource owner:** select your organization (e.g. `petry-projects`)

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.

it's clear enough.

Comment on lines +132 to +136
### 2. Create a PAT for the bot (classic or fine-grained)

You can use either a **classic** or **fine-grained** PAT. Fine-grained tokens are
recommended for better security (principle of least privilege).

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.

Fine Grained PAT is working bot the pr-review agent

Comment thread agents/pr-reviewer.md Outdated
Comment on lines +22 to +25
**Organization permissions:**
- `members:read` — read organization members for code owner routing

These are fine-grained token scopes. The legacy `repo` scope (which grants full repository control) is NOT required.
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b765813f4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/pr-review-agent/pr-review-agent.md Outdated
- **Resource owner:** select your organization (e.g. `petry-projects`)
- **Repository access:** All repositories (or specific repos if preferred)
- **Repository permissions:**
- `contents:read` — read files and diffs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require Contents write for auto-merge tokens

When the recommended fine-grained token is created with only contents:read, the approval path can still post reviews but cannot complete the workflow’s merge step: I checked scripts/post-pr-review.sh, which runs gh pr merge "$PR_URL" --auto --squash after approval, and GitHub’s pull-request merge API documents fine-grained tokens as needing Contents repository permission write. Because that command is best-effort (|| true), runs using this setup will report success while approved PRs never get auto-merge enabled; the setup docs should request contents:write for fine-grained tokens if auto-merge is part of the agent contract.

Useful? React with 👍 / 👎.

Comment on lines +215 to +216
for required_scope in contents pull_requests; do
if ! grep -qE "(^|[[:space:]])${required_scope}([[:space:]]|$)" <<< "$normalized_scopes"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop parsing OAuth scopes for fine-grained PATs

For runs that actually use a fine-grained PAT, this validation still fails before any review starts because gh auth status exposes OAuth scopes from the Token scopes: line, not fine-grained repository permissions such as contents or pull_requests; GitHub CLI’s own auth docs describe fine-grained PATs as having inherent resource scoping, and the CLI maintainers note that fine-grained permission information is not readily available for gh to detect. As a result, the recommended token path hits this loop with no matching scopes and exits 1 even when the token has the requested permissions; validate fine-grained tokens with a cheap API probe instead of checking Token scopes: for permission names.

Useful? React with 👍 / 👎.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): 0
No actionable issues found. The SonarQube Quality Gate passed with:
- 0 new issues
- 0 accepted issues  
- 0 security hotspots
- 0 open review threads from this bot
CI checks: no results (empty)
Blocking reviews: none
```
The PR is clean — no fixes required and no threads to resolve.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): 0
Notes:
- Quality Gate passed — 0 new issues, 0 security hotspots, 0 accepted issues
- No open review threads from sonarqubecloud[bot] to resolve
- No Tier 1 CI blockers (CI status and reviews JSON both empty)
- PR diff reviewed: .github/workflows/pr-review.yml, agents/pr-reviewer.md,
  docs/pr-review-agent/pr-review-agent.md — no SonarQube hotspot patterns found
```

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-review.yml:
- Around line 206-222: The scope validation currently parses the output into
normalized_scopes and then enforces exact matches for "contents" and
"pull_requests", which fails for fine-grained PATs because gh CLI may not expose
scopes; modify the logic around normalized_scopes and the for-required_scope
loop to first detect when gh could not determine scopes (e.g., normalized_scopes
is empty or contains the CLI's "could not determine" / "no token scopes"
message) and in that case skip/relax the strict grep checks (emit a warning and
continue) or alternatively attempt a different validation path (call the GitHub
API to validate token permissions) instead of requiring literal "contents" and
"pull_requests" matches; update the conditional that currently checks for repo
and the for-loop over required_scope to implement this fallback behavior.

In `@docs/pr-review-agent/pr-review-agent.md`:
- Around line 134-136: The docs conflict: the PR review agent doc recommends
fine-grained PATs but the bot-setup doc notes fine-grained tokens fail when
calling addPullRequestReview; reconcile by either removing the blanket
recommendation for fine-grained tokens or documenting the exact
permission/setting required to make addPullRequestReview work with fine-grained
PATs (or a temporary note that classic tokens are required); update references
to addPullRequestReview and the bot setup guidance so both documents
consistently state the supported token type and any necessary permissions or
workarounds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bb063c67-b77f-47ee-9320-090ba226b1d5

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8ad45 and 56171b2.

📒 Files selected for processing (3)
  • .github/workflows/pr-review.yml
  • agents/pr-reviewer.md
  • docs/pr-review-agent/pr-review-agent.md

Comment thread .github/workflows/pr-review.yml
Comment thread docs/pr-review-agent/pr-review-agent.md Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@donpetry-bot

Copy link
Copy Markdown
Contributor

@dev-lead - Review, research , analyze, address and resolve all open comments here.

@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@don-petry
don-petry merged commit 7b04261 into main Jun 6, 2026
24 checks passed
@don-petry
don-petry deleted the fix/pr-review-fine-grained-token-support branch June 6, 2026 14:05
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da8fe6a805

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +304 to +307
2. Ensure the `GH_PAT_WORKFLOWS` org-level secret is available to
`petry-projects/.github`. This secret is already present in the org; no
additional secret setup is required. The workflow template references
`GH_PAT_WORKFLOWS` throughout — use the same PAT created above in

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the bot PAT requirement for mention setup

In the mention-trigger setup, this now says no additional secret is required and that the template references GH_PAT_WORKFLOWS throughout, but the checked-in caller workflow still declares and passes DON_PETRY_BOT_GH_PAT as a required org secret for acknowledgement comments (.github/workflows/pr-review-mention.yml lines 22-23 and 41-43). For any repo following these instructions without exposing DON_PETRY_BOT_GH_PAT, the reusable call will receive an empty/missing bot token and the mention trigger cannot post acknowledgements as documented.

Useful? React with 👍 / 👎.

- `contents:read` — read files and diffs for analysis
- `pull_requests:write` — post reviews and comments
- **Organization permissions:**
- `members:read` — (optional) read org members for code owner routing at escalation time

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require members:read for team reviewer escalation

When a repo's CODEOWNERS contains team entries (for example @org/team) and the cascade escalates, scripts/request-codeowners-review.sh passes those entries to gh pr edit --add-reviewer; GitHub CLI team-reviewer operations with fine-grained PATs need the organization Members permission to resolve the team. Marking members:read as optional means users can create the recommended token and still have escalations silently fail to request the team reviewers, leaving only the label fallback.

Useful? React with 👍 / 👎.

- **Scopes:** ✅ `repo`, ✅ `workflow`, ✅ `read:org`
- **Token name:** `pr-review-agent`
- **Expiration:** 90 days (set a calendar reminder to rotate — fine-grained PATs do not auto-rotate)
- **Resource owner:** select your organization (e.g. `petry-projects`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the single-owner limit for fine-grained PATs

With this fine-grained setup, selecting petry-projects as the resource owner only grants access to repositories owned by that organization, but the workflow still enumerates both the bot account namespace and the target org (scripts/list-prs.sh calls search_namespace "$BOT_USER" before search_namespace "$TARGET_ORG"). In deployments that rely on the bot's personal repos being scanned, following these instructions will make those PRs disappear from the candidate pool; the docs should either require a classic PAT for multi-owner coverage or explicitly state that fine-grained PATs only support the selected owner.

Useful? React with 👍 / 👎.

don-petry added a commit that referenced this pull request Jun 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 15, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 18, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 21, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 23, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 23, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jul 14, 2026
…alse) (#1221)

* test(dev-lead): guard the #443 concurrency fix (cancel-in-progress: false)

The dev-lead multi-label issue-pickup race (#443) was fixed by #450's per-issue/
per-PR concurrency lanes with cancel-in-progress:false — same-lane labeled events
queue behind the active run instead of cancelling it, so the dev-lead-triggered
pickup always finishes. Add a regression guard that fails if anyone reintroduces
cancel-in-progress:true or drops the per-issue lane.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Juznz5V6su81ffSND8fg7s

* chore: dev-lead update (review-changes) [skip ci-relay]

* chore: dev-lead update (review-changes) [skip ci-relay]

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 2, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 3, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 3, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix: support fine-grained tokens in pr-review scope validation

The auth scope check was overly strict, requiring 'repo' scope (full repo control)
even though the PR review agent only needs read/write access to specific resources.

Changes:
- Modify scope validation to accept either classic PAT (repo scope) or fine-grained
  tokens (contents:read + pull_requests:write)
- Document required scopes in pr-reviewer.md with fine-grained token requirements
- Update pr-review-agent.md setup guide to recommend fine-grained tokens over
  classic PATs for better security (principle of least privilege)
- Support both token types for backward compatibility

This fixes PR #435 auth failure while improving security posture.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* chore: apply manual instructions [skip ci-relay]

* chore: apply manual instructions [skip ci-relay]

* fix: remove auto-merge to reduce token scope requirements

The PR review agent no longer enables auto-merge, which eliminates the need
for elevated repository permissions. This reduces the required token scopes
from 'repo' (full control) or 'contents:write' to just the minimal permissions:
- contents:read (read files and diffs)
- pull_requests:write (post reviews)
- members:read (optional, for escalation routing)

Changes:
- Remove auto-merge invocation from post-pr-review.sh
- Update documentation to reflect review-only workflow (no auto-merge)
- Simplify required token scopes in both agent and setup docs
- PRs remain open for manual merge by authors/maintainers after approval

This addresses the fine-grained token scope requirements raised in review
comments while maintaining the core review functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants