Skip to content

Commit dd8ede1

Browse files
committed
GH Actions: automate some label management
This is a quite straight-forward workflow to just remove some labels which should only be on open issues/open PRs and which should be removed once an issue or PR has been closed/merged. Just attempting to reduce yet some more manual labour.
1 parent 66052c9 commit dd8ede1

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/manage-labels.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Remove outdated labels
2+
3+
on:
4+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
5+
issues:
6+
types:
7+
- closed
8+
pull_request_target:
9+
types:
10+
- closed
11+
12+
jobs:
13+
on-issue-close:
14+
runs-on: ubuntu-latest
15+
if: github.repository_owner == 'squizlabs' && github.event.issue.state == 'closed'
16+
17+
name: Clean up labels on issue close
18+
19+
steps:
20+
- uses: mondeja/remove-labels-gh-action@v1
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
labels: |
24+
Status: awaiting feedback
25+
Status: close candidate
26+
Status: needs investigation
27+
Status: triage
28+
29+
on-pr-merge:
30+
runs-on: ubuntu-latest
31+
if: github.repository_owner == 'squizlabs' && github.event.pull_request.merged == true
32+
33+
name: Clean up labels on PR merge
34+
35+
steps:
36+
- uses: mondeja/remove-labels-gh-action@v1
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
labels: |
40+
Status: awaiting feedback
41+
Status: close candidate
42+
Status: needs investigation
43+
Status: triage
44+
45+
on-pr-close:
46+
runs-on: ubuntu-latest
47+
if: github.repository_owner == 'squizlabs' && github.event_name == 'pull_request_target' && github.event.pull_request.merged == false
48+
49+
name: Clean up labels on PR close
50+
51+
steps:
52+
- uses: mondeja/remove-labels-gh-action@v1
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
labels: |
56+
Status: awaiting feedback
57+
Status: close candidate
58+
Status: needs investigation
59+
Status: triage

0 commit comments

Comments
 (0)