Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.55 KB

README.md

File metadata and controls

43 lines (29 loc) · 1.55 KB

kyontan/slack-notify-action

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.

Notification example

screenshot of notification on success

screenshot of notification on failure

screenshot of notification on cancellation

Usage

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.