Action that notifies workflow status to Slack
Uses slackapi/slack-github-action internally and supports various ways to send.
Please refer above document for setup environment variables.
Add step using this action at the beginning of all steps.
(This is because the action sends notification in post
step, that will not be executed if the main
step skipped by the preliminary step failure)
name: build-something
on:
push: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Send notification to Slack
uses: kyontan/slack-notify-action@v1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
JOB_STATUS: ${{ job.status }}
- name: Build something
- ...
You have to pass JOB_STATUS
environment variable in addition to requirements by slackapi/slack-github-action.