GitHub Actions slackapi/slack-github-action Fails to Post
slackapi/slack-github-action could not deliver the message. The webhook URL or bot token is missing, the payload does not match the chosen posting technique, or Slack returned a transient error.
What this error means
The Slack step fails with an invalid_payload, no_text, or auth error, or a transient HTTP failure. The notification never reaches the channel.
Actions log
Error: An API error occurred: invalid_payload
# or
Error: Need to provide at least one botToken or webhook to use this actionCommon causes
Missing or wrong credential
The action needs either an incoming-webhook URL or a bot token. A missing secret, or supplying the wrong one for the technique you configured, fails authentication.
Payload does not match the technique
The webhook and bot-token techniques expect different payload shapes. A payload built for one rejected by the other yields invalid_payload or no_text.
How to fix it
Supply the credential and a matching payload
.github/workflows/notify.yml
- uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "Build ${{ job.status }} for ${{ github.ref_name }}"Match payload to technique; retry blips
- Use webhook + webhook-type for incoming webhooks, or a bot token for chat.postMessage.
- Build the payload in the shape the chosen technique expects.
- Re-run when the failure is a transient Slack HTTP error rather than an auth/payload error.
How to prevent it
- Store the webhook URL or bot token as a secret and reference it consistently.
- Match the payload shape to the posting technique.
- Retry transient Slack API errors.
Related guides
GitHub Actions codecov/codecov-action "Token required" / Upload RejectedFix codecov/codecov-action upload failures - a missing CODECOV_TOKEN on private repos, a transient upload end…
GitHub Actions peter-evans/create-pull-request 403 / Cannot Create PRFix peter-evans/create-pull-request failing to push or open a PR - missing pull-requests/contents write, or t…
GitHub Actions softprops/action-gh-release "Resource not accessible by integration"Fix softprops/action-gh-release failing to publish a release - missing contents: write permission, or a non-t…