-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.18 KB
/
issue-triager.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
# Adapted from: https://github.com/microsoft/azure-pipelines-tasks/blob/master/.github/workflows/blank.yml
# This action labels and assigns newly opened issues
name: Issue triager
on:
issues:
types: [opened]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: damccorm/tag-ur-it@master
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: "./triage-rules.yml"
- if: always()
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueLabels = await github.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
const isAnnouncement = issueLabels.data && issueLabels.data
.map(label => label.name)
.includes('Announcement');
if (!isAnnouncement) {
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['needs triage']
})
}