Skip to content

Commit

Permalink
Send slack notification on build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Nov 12, 2024
1 parent 93cd859 commit 3d39d46
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Smoke Test Homebrew install"
on:
schedule:
- cron: "0 0 * * *"
pull_request:
pull_request: # TODO: remove pull_request trigger

jobs:
smoke-test-homebrew:
Expand All @@ -15,3 +15,24 @@ jobs:
steps:
- run: brew install mongosh
- run: mongosh --smokeTests
- name: Report failure
# TODO: invert if-check below to only send on failure
if: !failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MONGOSH_DEVEL_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
uses: slackapi/[email protected]
with:
payload: |
{
"text": "Homebrew smoke test failed on macOS ${{ matrix.runner }}"
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Failed run: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
}
}
]
}

0 comments on commit 3d39d46

Please sign in to comment.