Skip to content

Slack notify

Slack notify #558

Workflow file for this run

name: Slack notify
on:
workflow_run:
workflows:
- CI
types:
- completed
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
jobs:
failure:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Slack
id: slack
uses: slackapi/slack-github-action@v1.23.0
with:
payload: |
{
"text": "${{ github.event.workflow_run.name }} failed: ${{ github.event.workflow_run.repository.name }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":no_entry: ${{ github.event.workflow_run.name }} failed"
}
}
],
"attachments": [
{
"color": "danger",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Repo: ${{ github.event.workflow_run.repository.html_url }}\nWorkflow name: `${{ github.event.workflow_run.name }}`\nJob url: ${{ github.event.workflow_run.html_url }}"
}
}
]
}
]
}