Skip to content

Commit

Permalink
Send slack notification if nightly build failed
Browse files Browse the repository at this point in the history
  • Loading branch information
teodanciu committed Jun 5, 2023
1 parent 6ae2dc3 commit fe23787
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/haskell.yml
Expand Up @@ -213,3 +213,31 @@ jobs:
run: nix-build
- name: nix-shell
run: nix-shell shell.nix

notify-nightly-failure:
name: Send a slack notification on \#ledger-internal if the nightly build failed
if: ${{ failure() }} && ${{ github.event_name == 'schedule'}}
runs-on: ubuntu-latest
needs:
- build
- nix-build
steps:
- name: Send slack notification
id: slack
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Nightly Github Actions build failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit fe23787

Please sign in to comment.