Skip to content

Commit 5ecb31f

Browse files
ci: add Copilot auto-review on new PRs (#70)
* ci: add Copilot auto-review on new PRs Automatically requests GitHub Copilot as a reviewer when PRs are opened or marked ready for review. Skips draft PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: use REST API to request Copilot review The gh CLI --add-reviewer flag treats 'copilot' as a regular user. Use the REST API /requested_reviewers endpoint instead, which properly handles the Copilot reviewer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 52aa5da commit 5ecb31f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Copilot Auto-Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
copilot-review:
12+
if: github.event.pull_request.draft == false
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Request Copilot Review
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: |
19+
gh api \
20+
--method POST \
21+
-H "Accept: application/vnd.github+json" \
22+
-H "X-GitHub-Api-Version: 2022-11-28" \
23+
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
24+
-f "reviewers[]=copilot"

0 commit comments

Comments
 (0)