-
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2.59 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Labeler
on:
issues:
types: [opened, labeled, closed]
pull_request:
types: [opened, labeled, closed]
jobs:
change-status-label:
name: Change status of issue or pull request on its status change
runs-on: ubuntu-latest
steps:
- name: "Add denied label when closed if it has pending label"
if: "contains(github.event.issue.labels.*.name, 'Status: Pending') && github.event.action == 'closed'"
uses: andymckay/labeler@master
with:
add-labels: "Status: Denied"
remove-labels: "Status: Pending"
- name: "Add resolved label when closed if it has accepted label"
if: "contains(github.event.issue.labels.*.name, 'Status: Accepted') && github.event.action == 'closed'"
uses: andymckay/labeler@master
with:
add-labels: "Status: Resolved"
remove-labels: "Status: Accepted"
- name: "Add default label when opened if it has no pending label"
if: "github.event.action == 'opened' && !contains(github.event.issue.labels.*.name, 'Status: Pending')"
uses: andymckay/labeler@master
with:
add-labels: "Status: Pending"
change-label-by-triage:
name: Change label by triage with label
runs-on: ubuntu-latest
if: "github.event.action == 'labeled'"
steps:
- name: "Remove pending and denied label when triaged"
if: "contains(github.event.issue.labels.*.name, 'Status: Pending') && github.event.label.name == 'Status: Accepted'"
uses: andymckay/labeler@master
with:
remove-labels: "Status: Pending, Status: Denied"
- name: "Change labels when Duplicated"
if: "github.event.label.name == 'Status: Duplicated'"
uses: andymckay/labeler@master
with:
add-labels: "Status: Denied"
- name: "Change labels when add Resolved label"
if: "github.event.label.name == 'Status: Resolved'"
uses: andymckay/labeler@master
with:
remove-labels: "Status: Accepted"
close-issue-by-label:
name: Close issue by label
if: "github.event.action == 'labeled' && (github.event.label.name == 'Status: Duplicated' || github.event.label.name == 'Status: Resolved')"
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Close pull request"
if: "${{ github.event.issue.pull_request }}"
run: "gh pr close ${github.event.issue.number} -R ${github.repository}"
- name: "Close issue"
if: "${{ !github.event.issue.pull_request }}"
run: "gh issue close ${github.event.issue.number} -R ${github.repository}"