From 95eda77436e09598ba75665da19ee233d67b10ea Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Mon, 11 May 2026 07:28:48 -0700 Subject: [PATCH] Add workflow to request Copilot review on maintainer PRs (#1587) 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. --- .github/workflows/copilot-review.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/copilot-review.yml diff --git a/.github/workflows/copilot-review.yml b/.github/workflows/copilot-review.yml new file mode 100644 index 000000000..4ed226a2f --- /dev/null +++ b/.github/workflows/copilot-review.yml @@ -0,0 +1,27 @@ +name: Request Copilot review + +on: + pull_request_target: + types: [opened, reopened, ready_for_review] + +permissions: + pull-requests: write + +jobs: + request-copilot-review: + if: >- + github.event.pull_request.draft == false && + contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) + 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"