Skip to content
Latchkey

rtCamp/action-slack-notify

Send a Slack channel notification from a workflow via an incoming webhook.

Community actionCategory: Notifications & ChatOpsLatest v2View on GitHub

What it does

rtCamp/action-slack-notify sends a formatted message to Slack through an incoming webhook, commonly as the last step of a deploy or on failure.

Unlike most actions it takes no with: inputs, everything is configured through environment variables (SLACK_WEBHOOK, SLACK_CHANNEL, SLACK_MESSAGE, SLACK_COLOR, SLACK_TITLE, SLACK_USERNAME, SLACK_ICON, and per-status variants like SLACK_MESSAGE_ON_FAILURE). Setting SLACKIFY_MARKDOWN converts markdown message bodies to Slack formatting.

Usage

workflow (.yml)
steps:
  - uses: rtCamp/action-slack-notify@v2
    env:
      SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
      SLACK_COLOR: ${{ job.status }}
      SLACK_TITLE: Deploy finished
      SLACK_MESSAGE: 'Deployed ${{ github.ref_name }} to production'

Notes

SLACK_WEBHOOK is a Slack Incoming Webhook URL created in your Slack app settings; store it as a repository secret.

SLACK_COLOR accepts ${{ job.status }} directly, so the message bar turns green/red to match the job outcome.

Common errors

  • A run that fails without posting anything usually means SLACK_WEBHOOK is empty, the secret name does not match or is not available to the workflow (fork PRs do not receive secrets).
  • Slack rejecting the request (e.g. no_service/404 from the webhook URL) means the webhook was revoked or the URL is wrong; regenerate the incoming webhook and update the secret.

Security and pinning

  • Treat the webhook URL as a secret, anyone holding it can post to your channel. Keep it in an encrypted secret and rotate it if it ever appears in logs.
  • Pin the action to a commit SHA; it runs as a published Docker image, so pinning fixes the exact image digest referenced by that revision.

Alternatives and related

Frequently asked questions

How do I only notify Slack when the build fails?
Add if: failure() to the notify step so it runs only when a previous step failed, and set SLACK_COLOR to ${{ job.status }} (or use SLACK_MESSAGE_ON_FAILURE) to style the alert.
Running rtCamp/action-slack-notify? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card