-
Notifications
You must be signed in to change notification settings - Fork 32
35 lines (31 loc) · 1021 Bytes
/
auto-assign.yml
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
31
32
33
34
35
name: Auto Assign PRs
on:
pull_request:
types: [opened, reopened]
jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Assign Reviewers and Assignees
uses: actions/github-script@v6
with:
script: |
const { github, context } = require('@actions/github');
const reviewers = ['danielcdz'];
const assignees = [context.actor];
// Add reviewers
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers,
});
// Add assignees
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
assignees,
});
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}