-
Notifications
You must be signed in to change notification settings - Fork 4.2k
79 lines (67 loc) · 2.62 KB
/
comment-commands.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "Comment Commands"
on:
issue_comment:
types:
- created
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
jobs:
issue-comment-job:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set-up Comvent
uses: rytswd/comvent@main
id: comvent
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-path: .github/comment-commands.yml
- if: steps.comvent.outputs.confirm-bug != ''
name: Handle confirmation command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "(S1 - Need Confirmation),stale"
gh issue edit "$ISSUE_NUMBER" --add-label "(S2 - Confirmed)"
gh issue reopen "$ISSUE_NUMBER"
- if: steps.comvent.outputs.close-duplicate != ''
name: Handle duplicate issue command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "(S1 - Need Confirmation),(S2 - Confirmed),stale"
gh issue edit "$ISSUE_NUMBER" --add-label "(S3 - Duplicate)"
- if: steps.comvent.outputs.close-invalid != ''
name: Handle invalid issue command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "(S1 - Need Confirmation),(S2 - Confirmed),stale"
gh issue edit "$ISSUE_NUMBER" --add-label "(S4 - Invalid)"
- if: steps.comvent.outputs.good-first-issue != ''
name: Handle good first issue command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "stale"
gh issue edit "$ISSUE_NUMBER" --add-label "Good First Issue"
gh issue reopen "$ISSUE_NUMBER"
- if: steps.comvent.outputs.help-wanted != ''
name: Handle help wanted command - Label
run: |
gh issue edit "$ISSUE_NUMBER" --remove-label "stale"
gh issue edit "$ISSUE_NUMBER" --add-label "Help Wanted"
gh issue reopen "$ISSUE_NUMBER"
pr-comment-job:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set-up Comvent
uses: rytswd/comvent@main
id: comvent
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-path: .github/comment-commands.yml
- if: steps.comvent.outputs.help-wanted != ''
name: Handle help wanted command - Label
run: |
gh pr edit "$ISSUE_NUMBER" --remove-label "stale"
gh pr edit "$ISSUE_NUMBER" --add-label "Help Wanted"
gh pr reopen "$ISSUE_NUMBER"