forked from PCL-Community/PCL2-CE
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.39 KB
/
issue-close.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: Auto Close Issues Based on Labels
on:
issues:
types: [labeled]
jobs:
auto-close-issue:
runs-on: ubuntu-latest
steps:
# 处理 not_planned 关闭类型
- name: Close as not planned
if: |
contains('❌ 拒绝,😂 移交上游,❌ 忽略,❌ 第三方,❌ 暂无计划', github.event.label.name)
env:
GITHUB_TOKEN: ${{ secrets.BOT }}
run: |
gh api \
--method PATCH \
/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-f state=closed \
-f state_reason="not_planned"
# 处理 completed 关闭类型
- name: Close as completed
if: github.event.label.name == '👌 完成'
env:
GITHUB_TOKEN: ${{ secrets.BOT }}
run: |
gh api \
--method PATCH \
/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-f state=closed \
-f state_reason="completed"
# 处理 duplicate 关闭类型
- name: Close as duplicate
if: github.event.label.name == '❌ 重复'
env:
GITHUB_TOKEN: ${{ secrets.BOT }}
run: |
gh api \
--method PATCH \
/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-f state=closed \
-f state_reason="duplicate"