-
-
Notifications
You must be signed in to change notification settings - Fork 37
297 lines (285 loc) Β· 11.6 KB
/
notify-tsc-members-mention.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# This action is centrally managed in https://github.com/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
# This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
name: Notify slack and email subscribers whenever TSC members are mentioned in GitHub
on:
issue_comment:
types:
- created
discussion_comment:
types:
- created
issues:
types:
- opened
pull_request_target:
types:
- opened
discussion:
types:
- created
jobs:
issue:
if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members')
name: TSC notification on every new issue
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: issuemarkdown
with:
markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
- name: Send info about issue
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New issue that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}');
pull_request:
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
name: TSC notification on every new pull request
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: prmarkdown
with:
markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New PR that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}');
discussion:
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
name: TSC notification on every new discussion
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: discussionmarkdown
with:
markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New discussion that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}');
issue_comment:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
name: TSC notification on every new comment in issue
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: issuemarkdown
with:
markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about issue comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New comment under existing issue that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
pr_comment:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
name: TSC notification on every new comment in pr
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: prmarkdown
with:
markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about PR comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New comment under existing PR that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
discussion_comment:
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
name: TSC notification on every new comment in discussion
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
#########
# Handling Slack notifications
#########
- name: Convert markdown to slack markdown
uses: asyncapi/.github/.github/actions/slackify-markdown@master
id: discussionmarkdown
with:
markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about discussion comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: π New comment under existing discussion that requires TSC Members attention π
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true
#########
# Handling Mailchimp notifications
#########
- name: Install deps
run: npm install
working-directory: ./.github/workflows/scripts/mailchimp
- name: Send email with MailChimp
uses: actions/github-script@v6
env:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}');