File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -332,6 +332,16 @@ jobs:
332332 GH_REPOSITORY : ${{ github.repository }}
333333 PR_NUMBER : ${{ github.event.pull_request.number }}
334334 run : |
335+ # Request Copilot at most once per PR. It is removed from requested_reviewers once
336+ # it finishes, so a pending-request check alone would re-request on every push.
337+ # Skip if Copilot has already submitted a review (diminishing returns on re-reviews);
338+ # a maintainer can still manually re-request from the PR UI when needed.
339+ reviewed=$(gh api "/repos/${GH_REPOSITORY}/pulls/${PR_NUMBER}/reviews" --paginate \
340+ --jq '.[].user.login')
341+ if echo "$reviewed" | grep -q 'copilot-pull-request-reviewer'; then
342+ echo 'Copilot has already reviewed this PR; not requesting again.'
343+ exit 0
344+ fi
335345 existing=$(gh api "/repos/${GH_REPOSITORY}/pulls/${PR_NUMBER}/requested_reviewers" --jq '.users[].login')
336346 if echo "$existing" | grep -q 'copilot-pull-request-reviewer'; then
337347 echo 'Copilot review already requested.'
You can’t perform that action at this time.
0 commit comments