forked from PCL-Community/PCL2-CE
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.69 KB
/
labels.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
name: Add labels based on issue closure reason
on:
issues:
types: [closed]
jobs:
add-labels:
runs-on: ubuntu-latest
steps:
- name: Check if the issue was closed as completed and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'completed') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['👌 完成']
});
}
- name: Check if the issue was closed as duplicate and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'duplicate') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['❌ 重复']
});
}
- name: Check if the issue was closed as not planned and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT }}
script: |
if (context.payload.issue.state_reason === 'not_planned') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['❌ 忽略']
});
}