Skip to content

Commit c0cfedb

Browse files
committed
ci: error if the api method or webhook fail to send data
1 parent 1ebcdfb commit c0cfedb

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/develop.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
id: wfb
2626
uses: ./
2727
with:
28+
errors: true
2829
webhook: ${{ secrets.SLACK_WEBHOOK_TRIGGER }}
2930
webhook-type: webhook-trigger
3031
payload: |
@@ -37,6 +38,7 @@ jobs:
3738
id: api
3839
uses: ./
3940
with:
41+
errors: true
4042
method: chat.postMessage
4143
token: ${{ secrets.SLACK_BOT_TOKEN }}
4244
payload: |
@@ -46,6 +48,7 @@ jobs:
4648
id: slack
4749
uses: ./
4850
with:
51+
errors: true
4952
method: chat.postMessage
5053
token: ${{ secrets.SLACK_BOT_TOKEN }}
5154
payload: |
@@ -61,6 +64,7 @@ jobs:
6164
id: stats
6265
uses: ./
6366
with:
67+
errors: true
6468
method: chat.postMessage
6569
token: ${{ secrets.SLACK_BOT_TOKEN }}
6670
payload: |
@@ -73,6 +77,7 @@ jobs:
7377
id: finished
7478
uses: ./
7579
with:
80+
errors: true
7681
method: chat.update
7782
token: ${{ secrets.SLACK_BOT_TOKEN }}
7883
payload: |
@@ -88,6 +93,7 @@ jobs:
8893
- name: Include ending statistics
8994
uses: ./
9095
with:
96+
errors: true
9197
method: chat.postMessage
9298
token: ${{ secrets.SLACK_BOT_TOKEN }}
9399
payload: |
@@ -97,6 +103,7 @@ jobs:
97103
- name: Celebrate wins
98104
uses: ./
99105
with:
106+
errors: true
100107
method: reactions.add
101108
token: ${{ secrets.SLACK_BOT_TOKEN }}
102109
payload: |
@@ -107,6 +114,7 @@ jobs:
107114
id: file
108115
uses: ./
109116
with:
117+
errors: true
110118
method: files.uploadV2
111119
token: ${{ secrets.SLACK_BOT_TOKEN }}
112120
payload: |
@@ -117,6 +125,7 @@ jobs:
117125
- name: Write one final webhook
118126
uses: ./
119127
with:
128+
errors: true
120129
webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
121130
webhook-type: incoming-webhook
122131
payload: |

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
id: wfb
6767
uses: ./
6868
with:
69+
errors: true
6970
webhook: ${{ secrets.SLACK_WEBHOOK_TRIGGER }}
7071
webhook-type: webhook-trigger
7172
payload: |
@@ -82,6 +83,7 @@ jobs:
8283
id: message
8384
uses: ./
8485
with:
86+
errors: true
8587
method: chat.postMessage
8688
token: ${{ secrets.SLACK_BOT_TOKEN }}
8789
payload: |
@@ -95,6 +97,7 @@ jobs:
9597
id: blocks
9698
uses: ./
9799
with:
100+
errors: true
98101
method: chat.postMessage
99102
token: ${{ secrets.SLACK_BOT_TOKEN }}
100103
payload: |
@@ -114,6 +117,7 @@ jobs:
114117
id: timer
115118
uses: ./
116119
with:
120+
errors: true
117121
method: chat.postMessage
118122
token: ${{ secrets.SLACK_BOT_TOKEN }}
119123
payload: |
@@ -131,6 +135,7 @@ jobs:
131135
id: finished
132136
uses: ./
133137
with:
138+
errors: true
134139
method: chat.update
135140
token: ${{ secrets.SLACK_BOT_TOKEN }}
136141
payload: |
@@ -148,6 +153,7 @@ jobs:
148153
id: done
149154
uses: ./
150155
with:
156+
errors: true
151157
method: chat.postMessage
152158
token: ${{ secrets.SLACK_BOT_TOKEN }}
153159
payload: |
@@ -159,6 +165,7 @@ jobs:
159165
id: file
160166
uses: ./
161167
with:
168+
errors: true
162169
method: files.uploadV2
163170
token: ${{ secrets.SLACK_BOT_TOKEN }}
164171
payload: |
@@ -170,6 +177,7 @@ jobs:
170177
- name: "integration(method): react to the completed update message"
171178
uses: ./
172179
with:
180+
errors: true
173181
method: reactions.add
174182
token: ${{ secrets.SLACK_BOT_TOKEN }}
175183
payload: |
@@ -184,6 +192,7 @@ jobs:
184192
id: incoming
185193
uses: ./
186194
with:
195+
errors: true
187196
webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
188197
webhook-type: incoming-webhook
189198
payload: |
@@ -207,6 +216,7 @@ jobs:
207216
id: payload_file
208217
uses: ./
209218
with:
219+
errors: true
210220
payload-file-path: ./.github/resources/.slack/incoming-webhook.json
211221
payload-templated: true
212222
webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }}

0 commit comments

Comments
 (0)