-
Notifications
You must be signed in to change notification settings - Fork 85
30 lines (27 loc) · 1.02 KB
/
copilot-review.yml
File metadata and controls
30 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Request Copilot review
on:
pull_request_target:
types: [opened, reopened, ready_for_review]
permissions:
pull-requests: write
jobs:
request-copilot-review:
# Same-repo PRs only. author_association in the pull_request_target payload
# reports CONTRIBUTOR for org members on same-repo branches, so head==base
# is the reliable maintainer signal (it requires push access to the base repo).
if: >-
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- name: Request Copilot review
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
"/repos/${REPO}/pulls/${PR_NUMBER}/requested_reviewers" \
-f "reviewers[]=Copilot"