diff --git a/.github/workflows/copilot-review.yml b/.github/workflows/copilot-review.yml new file mode 100644 index 0000000..8c973fc --- /dev/null +++ b/.github/workflows/copilot-review.yml @@ -0,0 +1,27 @@ +name: Request Copilot review + +on: + pull_request: + types: [opened, ready_for_review] + +permissions: + pull-requests: write + contents: read + +jobs: + request-copilot-review: + if: ${{ !github.event.pull_request.draft }} + runs-on: ubuntu-latest + steps: + - name: Request review from Copilot + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + gh api \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + "repos/$REPO/pulls/$PR_NUMBER/requested_reviewers" \ + -f 'reviewers[]=Copilot' \ + || echo "Copilot review request failed — check org Copilot seat config."