Skip to content
Latchkey

slackapi/slack-github-action

Send a message to Slack from a workflow, via a bot token or an incoming webhook.

Community actionCategory: Notifications & ChatOpsLatest v2View on GitHub

What it does

slackapi/slack-github-action sends messages to Slack so a channel sees build results. In v2 you choose a technique: call a Slack API method with a bot token, or POST to an incoming webhook.

It is the common way to alert a team when a deploy or a main-branch build fails.

Usage

workflow (.yml)
steps:
  - uses: slackapi/slack-github-action@v2
    with:
      method: chat.postMessage
      token: ${{ secrets.SLACK_BOT_TOKEN }}
      payload: |
        channel: C0123456789
        text: "Build ${{ job.status }} for ${{ github.ref_name }}"

Inputs

InputDescriptionDefaultRequired
methodSlack API method to call (bot-token technique).-No
tokenSlack bot token (for the API method technique).-No
webhookIncoming webhook URL (webhook technique).-No
webhook-typeWebhook type, e.g. incoming-webhook.-No
payloadMessage payload (JSON or YAML).-No

Notes

v2 reorganized inputs around techniques. A v1 config will not work unchanged; consult the README when upgrading.

Common errors

  • not_authed or invalid_auth means the bot token is missing or wrong.
  • channel_not_found means the bot is not in the target channel or the ID is wrong.

Security and pinning

  • Store the bot token or webhook URL as a secret. Pin the action SHA.

Frequently asked questions

Should I use a bot token or a webhook?
A bot token with chat.postMessage is more flexible (threads, updates, rich formatting). An incoming webhook is simpler for a single channel.
Running slackapi/slack-github-action? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card