Skip to content

Commit

Permalink
chore(synthetic-monitoring): adding notification when all jobs fail (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdias authored May 8, 2024
1 parent 1a493f6 commit 809c499
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/scheduled-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,45 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

failure-notification:
name: Check failure
needs: [pokeshop-trace-based-tests, pokeshop-serverless-trace-based-tests, otel-demo-trace-based-tests]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Send message on Slack
if: ${{ needs.pokeshop-trace-based-tests.result == 'failure' && needs.pokeshop-serverless-trace-based-tests.result == 'failure' && needs.otel-demo-trace-based-tests.result == 'failure' }}
uses: slackapi/[email protected]
with:
# check the block kit builder docs to understand how it works
# and how to modify it: https://api.slack.com/block-kit
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":red_circle: :loudspeaker: All synthetic monitoring crashed :loudspeaker: :red_circle:",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:*\nFailed"
},
{
"type": "mrkdwn",
"text": "*Pipeline:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit 809c499

Please sign in to comment.