This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Add workflow to auto-assign Copilot as reviewer on pull requests #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-assign Copilot Reviewer | |
| on: | |
| pull_request: | |
| types: [opened, reopened, ready_for_review] | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| assign-copilot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add Copilot as reviewer | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const pull_number = context.payload.pull_request.number; | |
| try { | |
| await github.rest.pulls.requestReviewers({ | |
| owner, | |
| repo, | |
| pull_number, | |
| reviewers: ['copilot'] | |
| }); | |
| console.log('Successfully added @copilot as reviewer'); | |
| } catch (error) { | |
| console.log('Error adding @copilot as reviewer:', error.message); | |
| } |