-
Notifications
You must be signed in to change notification settings - Fork 8
125 lines (106 loc) · 3.99 KB
/
submission-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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Submission Comment Bot
on:
issues:
types: [labeled]
jobs:
deadlines:
if: "${{ contains(github.event.label.name, 'deadline: 2 weeks') }}"
runs-on: ubuntu-latest
steps:
- name: Create comment
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hey @${{ github.event.issue.user.login }},
your module submission was labeled with a deadline of **two weeks**.
If you don't respond within that period, your module will be rejected.
*Best regards,
The MMAR Team*
spam:
if: ${{ contains(github.event.label.name, 'spam') }}
runs-on: ubuntu-latest
steps:
- name: Set labels
uses: actions-cool/issues-helper@v3
with:
actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'spam'
- name: Create comment
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hey @${{ github.event.issue.user.login }},
your submission was closed due to being considered spam.
*Best regards,
The MMAR Team*
- name: Close issue
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue'
close-reason: not_planned
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
approved:
if: ${{ startsWith(github.event.issue.title, '[Module]') && contains(github.event.label.name, 'approved') }}
runs-on: ubuntu-latest
steps:
- name: Add labels
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: "approved"
- name: Format Module ID
id: app_mod_name
run: |
echo "MODULE_ID=$SUB_TITLE" | sed 's/\(MODULE_ID=\)\[Module\] */\1/' >> $GITHUB_OUTPUT
env:
SUB_TITLE: ${{ github.event.issue.title }}
- name: Create comment
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hey @${{ github.event.issue.user.login }},
your module submission has been approved!
The module will likely be available at https://github.com/${{ github.repository_owner }}/${{ steps.app_mod_name.outputs.MODULE_ID }}.
Check your e-mail inbox for an invite to your new repository and remember to 'Watch' your repository on Github to have new issues in it show up in your feed.
Make sure to change your local repository's push URLs or configure 2 parallel push URLs.
*Best regards,
The MMAR Team*
- name: Close issue
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }}
close-reason: completed
issue-number: ${{ github.event.issue.number }}
rejected:
if: ${{ contains(github.event.label.name, 'rejected') }}
runs-on: ubuntu-latest
steps:
- name: Add labels
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: "rejected"
- name: Close issue
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }}
close-reason: not_planned
issue-number: ${{ github.event.issue.number }}