-
Notifications
You must be signed in to change notification settings - Fork 1.2k
46 lines (45 loc) · 1.47 KB
/
pr-labeler.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
36
37
38
39
40
41
42
43
44
45
46
name: "Pull Request Labeler"
on:
pull_request_target:
types: [opened]
jobs:
apply-file-based-labels:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
apply-internal-external-label:
needs: apply-file-based-labels
if: ${{ always() }}
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const maintainers = [
'aws-sam-cli-bot',
'jfuss', 'hoffa', 'awood45', 'aahung', 'hawflau', 'mndeveci', 'ssenchenko',
'qingchm', 'moelasmar', 'xazhao', 'mildaniel', 'marekaiv', 'torresxb1',
'lucashuy', 'hnnasit', 'sriram-mv','dependabot[bot]'
]
if (maintainers.includes(context.payload.sender.login)) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['pr/internal']
})
} else {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['pr/external', 'stage/needs-triage']
})
}