Auto-request Copilot review on maintainer PRs (#1587)#1588
Merged
Conversation
Fires on pull_request_target (opened, reopened, ready_for_review) and only requests review when author_association is OWNER, MEMBER, or COLLABORATOR. Drafts are skipped. Uses pull_request_target so the job has write access on fork-based PRs.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an automation workflow to request a GitHub Copilot review on PRs authored by maintainers/collaborators, reducing the need for manual reviewer assignment while avoiding spending review budget on drive-by fork PRs.
Changes:
- Introduces a new
pull_request_targetworkflow triggered onopened,reopened, andready_for_review. - Gates execution to non-draft PRs where
author_associationisOWNER,MEMBER, orCOLLABORATOR. - Uses
gh apito call the REST endpoint that requests a reviewer on the PR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+27
| run: | | ||
| gh api \ | ||
| --method POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| "/repos/${REPO}/pulls/${PR_NUMBER}/requested_reviewers" \ | ||
| -f "reviewers[]=Copilot" |
Contributor
Author
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Copilot stopped work on behalf of
brendancol due to an error
May 11, 2026 14:44
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.
Closes #1587.
Adds
.github/workflows/copilot-review.yml. It fires onpull_request_targetforopened,reopened, andready_for_review, and requests Copilot as a reviewer only whenauthor_associationisOWNER,MEMBER, orCOLLABORATOR. Drafts are skipped.pull_request_target(notpull_request) is intentional — the job needspull-requests: write, and that token scope is denied on PRs from forks under thepull_requestevent. Since the workflow does not check out PR code and only calls the reviewers REST API, running in the base-repo context is safe.Test plan