Skip to content

Commit 3ca9559

Browse files
committed
chore(ci): add job dependences for success and failure notification jobs
1 parent ed722c2 commit 3ca9559

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/stencil-nightly.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,29 +226,33 @@ jobs:
226226
if: ${{ needs.test-react-e2e.result != 'success' }}
227227
run: exit 1
228228

229-
send-results-messages:
229+
send-success-messages:
230+
needs: [test-core-clean-build, test-core-lint, test-core-spec, verify-screenshots, verify-test-vue-e2e, verify-test-angular-e2e, verify-test-react-router-e2e, verify-test-react-e2e]
230231
runs-on: ubuntu-latest
232+
if: ${{ !cancelled() && contains(needs.*.result, 'success') }}
231233
steps:
232234
- name: Notify success on Discord
233-
if: success()
234235
run: |
235236
curl -H "Content-Type:application/json" \
236-
-d '{"content": "Alerting <@1347593178580254761>!", "embeds": [{"title": "✅ Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "color": 65280, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
237-
${{secrets.DISCORD_NOTIFY_WEBHOOK}}
238-
- name: Notify failure on Discord
239-
if: failure()
240-
run: |
241-
curl -H "Content-Type:application/json" \
242-
-d '{"embeds": [{"title": "❌ Workflow ${{github.workflow}} #${{github.run_number}} failed", "color": 16711680, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
237+
-d '{"embeds": [{"title": "✅ Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "color": 65280, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
243238
${{secrets.DISCORD_NOTIFY_WEBHOOK}}
244239
- name: Notify success on Slack
245-
if: success()
246240
run: |
247241
curl -H "Content-Type:application/json" \
248242
-d '{"title": "✅ Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \
249243
${{secrets.SLACK_NOTIFY_SUCCESS_WEBHOOK}}
244+
245+
send-failure-messages:
246+
needs: [test-core-clean-build, test-core-lint, test-core-spec, verify-screenshots, verify-test-vue-e2e, verify-test-angular-e2e, verify-test-react-router-e2e, verify-test-react-e2e]
247+
runs-on: ubuntu-latest
248+
if: ${{ !cancelled() && contains(needs.*.result, 'success') }}
249+
steps:
250+
- name: Notify failure on Discord
251+
run: |
252+
curl -H "Content-Type:application/json" \
253+
-d '{"content": "Alerting <@&1347593178580254761>!", "embeds": [{"title": "❌ Workflow ${{github.workflow}} #${{github.run_number}} failed", "color": 16711680, "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}]}' \
254+
${{secrets.DISCORD_NOTIFY_WEBHOOK}}
250255
- name: Notify failure on Slack
251-
if: failure()
252256
run: |
253257
curl -H "Content-Type:application/json" \
254258
-d '{"title": "❌ Workflow ${{github.workflow}} #${{github.run_number}} failed", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \

0 commit comments

Comments
 (0)