Skip to content
bell

GitHub Action

Job notification by Slack

1.0 Latest version

Job notification by Slack

bell

Job notification by Slack

Send slack message by Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Job notification by Slack

uses: ghactions-utilities/[email protected]

Learn more about this action in ghactions-utilities/slack-notification

Choose a version

This action is a part of ghactions-utilities created by trquangvinh.

Slack Notification

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

A GitHub Action to send a message to a Slack channel.

Usage

- uses: ghactions-utilities/slack-notification@main
  with:
    # Description: Slack Webhook URL
    # Require: true
    # Type: string
    webhook-url: ''

    # Description: Workflow job status
    # Allowed values: success | failure | cancelled
    # Require: true
    # Type: string
    job-status: ''

    # Description: Slack message
    # Require: false
    # Type: string
    # If `message` not set, we will use last commit message instead of.
    message: Typing the message which you wanna send to Slack

Example

name: Slack Notification

on: push

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: Send slack notification
        uses: ghactions-utilities/slack-notification@main
        with:
          webhook-url: ${{ secrets.WEBHOOK_URL }}
          job-status: ${{ job.status }}
          message: Hello world!