docs: restrict PR reviewer workflows to COMMENT-only by default#47860
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
July 24, 2026 21:03
View session
pelikhan
reviewed
Jul 24, 2026
|
|
||
| ## Default Review Event: COMMENT Only | ||
|
|
||
| **The GitHub Actions actor (`GITHUB_TOKEN`) is only permitted to post `COMMENT` reviews. It cannot `APPROVE` or `REQUEST_CHANGES` on a pull request.** |
Collaborator
There was a problem hiding this comment.
@copilot it can request changes but not approve
Contributor
Author
There was a problem hiding this comment.
Fixed in 2b4bad9 — updated to allowed-events: [COMMENT, REQUEST_CHANGES] and clarified that only APPROVE is blocked by the default GITHUB_TOKEN.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
approved these changes
Jul 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Documents safe review events for workflows using the default GITHUB_TOKEN.
Changes:
- Adds review-event guidance and configuration, but incorrectly permits
REQUEST_CHANGES.
Show a summary per file
| File | Description |
|---|---|
.github/aw/pr-reviewer.md |
Adds default review-event guidance and example. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
.github/aw/pr-reviewer.md:42
- The example still permits
REQUEST_CHANGES, contrary to the documented COMMENT-only default. A workflow copied from this snippet can select an event that the default token cannot submit, so the allowlist must contain onlyCOMMENT.
allowed-events: [COMMENT, REQUEST_CHANGES]
.github/aw/pr-reviewer.md:45
- The warning only covers
APPROVE, leaving readers with the incorrect conclusion thatREQUEST_CHANGESworks withGITHUB_TOKEN. Include both unsupported events so the guidance is consistent with the COMMENT-only constraint.
Do not instruct the agent to approve a PR unless the workflow uses a PAT or app token with explicit pull-request approval permissions. Using `APPROVE` with the default `GITHUB_TOKEN` will fail at runtime.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Medium
Comment on lines
+32
to
+36
| ## Default Review Events: No APPROVE | ||
|
|
||
| **The GitHub Actions actor (`GITHUB_TOKEN`) cannot `APPROVE` a pull request. It can post `COMMENT` and `REQUEST_CHANGES` reviews.** | ||
|
|
||
| By default, configure `submit-pull-request-review` with `allowed-events: [COMMENT, REQUEST_CHANGES]` to enforce this constraint: |
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GITHUB_TOKENin GitHub Actions is only permitted to postCOMMENTreviews — it cannotAPPROVEorREQUEST_CHANGES. Thepr-reviewer.mdinstruction file had no guidance on this, leaving agents free to attempt operations that fail at runtime.Changes
.github/aw/pr-reviewer.md: Added "Default Review Event: COMMENT Only" sectionGITHUB_TOKENconstraint explicitlyallowed-events: [COMMENT]as the default safe-outputs configurationAPPROVE/REQUEST_CHANGESrequire a PAT or app token with explicit pull-request approval permissions