Skip to content
Latchkey

GitHub Actions slackapi/slack-github-action "invalid_auth"

slack-github-action supports several techniques (bot token, webhook, incoming webhook). The bot-token technique calls the Slack Web API, which returns invalid_auth when the SLACK_BOT_TOKEN is empty, wrong, or not scoped for the method.

What this error means

A slack-github-action step fails with the Slack API error invalid_auth when posting a message.

github-actions
Error: An API error occurred: invalid_auth
Error: The request to the Slack API failed.

Common causes

Missing or wrong bot token

SLACK_BOT_TOKEN unset, mismatched, or unavailable on the trigger resolves to an invalid credential.

Technique/credential mismatch

Using the bot-token technique while only a webhook URL is configured (or vice versa) fails auth.

How to fix it

Match the technique to a valid credential

  1. For chat.postMessage, set the bot token via the env and the channel-id input.
  2. For webhook posting, switch to the webhook technique with a webhook URL secret.
  3. Confirm the secret has a value on this trigger.
.github/workflows/notify.yml
- uses: slackapi/slack-github-action@v2
  with:
    method: chat.postMessage
    token: ${{ secrets.SLACK_BOT_TOKEN }}
    payload: |
      channel: C0123456789
      text: "Build complete"

How to prevent it

  • Pick one technique and supply the matching credential.
  • Verify the Slack token scopes cover the method you call.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →