Skip to content
message-square

GitHub Action

Send Slack Messages

v2.0.0 Latest version

Send Slack Messages

message-square

Send Slack Messages

Send a Slack message on different occasions

Installation

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

              

- name: Send Slack Messages

uses: chrimaeon/github-slack-action@v2.0.0

Learn more about this action in chrimaeon/github-slack-action

Choose a version

GitHub Slack Message Action

Build & Test codecov

This action sends a message to a Slack channel

Inputs

slack_token:

Required

The OAuth token from your Slack App

channel:

Required

The channel to post into

text:

Required

The text to send

blocks:

The Slack Blocks-Kit part of the message (https://api.slack.com/block-kit)

Example usage

name: Send Slack Message

on:
  workflow-dispatch:

jobs:
  send-message:
    runs-on: ubuntu-latest
    steps:
      - name: Notify Slack
        uses: chrimaeon/github-slack-action@2
        with:
          slack_token: ${{ secrets.SLACK_TOKEN }}
          channel: ${{ secrets.SLACK_CHANNEL }}
          text: "The is my first message, yay!"
          blocks: |
            [
              {
                "type": "header",
                "text": {
                  "type": "plain_text",
                  "text": "Hello World!"
                }
              },
              {
                "type": "section",
                "text": {
                  "type": "mrkdwn",
                  "text": "from **Github Slack Action**!"
                }
              }
            ]