forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.58 KB
/
auto_request_review.yml
File metadata and controls
43 lines (41 loc) · 1.58 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
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Auto Request Review
on:
pull_request:
types: [opened, ready_for_review]
jobs:
auto-request-review:
# Don't run on forked repos
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'pytorch' }}
permissions:
contents: read
pull-requests: write
name: Auto Request Review
runs-on: ubuntu-latest
steps:
- name: Request review based on files changes and/or groups the author belongs to
id: auto-request-review
# v0.7.0
uses: necojackarc/auto-request-review@e08cdffa277d50854744de3f76230260e61c67f4 # v0.7.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Add triaged label if reviewers are present
if: ${{ steps.auto-request-review.outputs.reviewers != '' || steps.auto-request-review.outputs.team_reviewers != '' }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
try {
const { owner, repo, number } = context.issue;
await github.rest.issues.addLabels({
owner,
repo,
issue_number: number,
labels: ['triaged'],
});
console.log('Label added: triaged');
} catch (error) {
console.error('Failed to add triaged label:', error.message);
core.setFailed(error.message);
}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true