Skip to content

Commit abd3eac

Browse files
chore(ci): send alert message when stencil-nightly workflow finishes (#30743)
Send alert to a Discord channel using a webhook. --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - If a step in the workflow fails, an alert message will be sent to a Discord channel using a webhook. ## Does this introduce a breaking change? - [ ] Yes - [X] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Brandy Smith <[email protected]>
1 parent 54a1c86 commit abd3eac

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/stencil-nightly.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,35 @@ jobs:
225225
- name: Check build matrix status
226226
if: ${{ needs.test-react-e2e.result != 'success' }}
227227
run: exit 1
228+
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]
231+
runs-on: ubuntu-latest
232+
if: ${{ !cancelled() && contains(needs.*.result, 'success') }}
233+
steps:
234+
- name: Notify success on Discord
235+
run: |
236+
curl -H "Content-Type:application/json" \
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}}"}]}' \
238+
${{secrets.DISCORD_NOTIFY_WEBHOOK}}
239+
- name: Notify success on Slack
240+
run: |
241+
curl -H "Content-Type:application/json" \
242+
-d '{"title": "✅ Workflow ${{github.workflow}} #${{github.run_number}} finished successfully", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \
243+
${{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, 'failure') }}
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}}
255+
- name: Notify failure on Slack
256+
run: |
257+
curl -H "Content-Type:application/json" \
258+
-d '{"title": "❌ Workflow ${{github.workflow}} #${{github.run_number}} failed", "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"}' \
259+
${{secrets.SLACK_NOTIFY_FAILURE_WEBHOOK}}

0 commit comments

Comments
 (0)