Skip to content

chrimaeon/github-slack-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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@1
        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**!"
                }
              }
            ]