notify slack on failure
This commit is contained in:
parent
244fcd56a0
commit
6e955f27c5
|
@ -1,12 +1,17 @@
|
||||||
on: push
|
name: Slack Notification
|
||||||
name: Slack Notification Demo
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Backend Tests"]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
slackNotification:
|
send_notification:
|
||||||
name: Slack Notification
|
if: ${{ failure() }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Send Slack notification
|
||||||
- name: Slack Notification
|
run: |
|
||||||
uses: rtCamp/action-slack-notify@v2
|
curl -X POST -H 'Content-type: application/json' \
|
||||||
env:
|
--data '{"text":"Workflow <${{ github.event.workflow_run.html_url }}|${{ github.event.workflow.name }}> failed!"}' \
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
|
Loading…
Reference in New Issue