Notify Webhook
Send a notification to Slack, Discord, Teams, or any webhook URL.
Reference: loha/notify-webhook@v1
Category: deploy
Runtime: curlimages/curl:8.5.0 (non-root, digest-pinned)
License: Apache-2.0
When to use
Use this step for ChatOps notifications outside Thailand or for any webhook endpoint that accepts JSON. Choose WEBHOOK_FORMAT to match the target platform; payload shape differs.
Parameters
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
WEBHOOK_URL | string | — | Yes | Webhook URL for Slack, Discord, Teams, or custom endpoint. |
MESSAGE | string | — | Yes | Message body to send. |
STATUS | enum: success, failure, info | success | No | Build status: success, failure, or info. |
TITLE | string | Pipeline Notification | No | Notification title shown in the attachment or embed. |
COLOR | string | #36a64f | No | Attachment color for Slack/Discord (hex code). Defaults to green. |
WEBHOOK_FORMAT | enum: slack, discord, teams, raw | slack | No | Webhook payload format: slack, discord, teams, or raw. |
Workspaces
No workspaces required. This task only makes outbound calls.
Results
| Result | Description |
|---|---|
NOTIFY_RESULT | Notification result (sent or failed) |
HTTP_STATUS | HTTP response status code from the webhook endpoint |
How it works
POSTs to WEBHOOK_URL with a JSON body shaped per WEBHOOK_FORMAT. slack produces an Incoming Webhook payload with attachments; discord produces an Embed; teams produces an Office 365 connector card; raw posts the raw MESSAGE body unchanged. The HTTP response code is exposed as HTTP_STATUS.
Examples
Slack on success
steps:
- name: notify-slack
uses: loha/notify-webhook@v1
with:
WEBHOOK_URL: '$(secrets.SLACK_WEBHOOK_URL)'
MESSAGE: 'Build $(context.pipelineRun.name) completed successfully'
STATUS: 'success'
TITLE: 'Pipeline Build'
WEBHOOK_FORMAT: 'slack'
Discord notification
steps:
- name: notify-discord
uses: loha/notify-webhook@v1
with:
WEBHOOK_URL: '$(secrets.DISCORD_WEBHOOK_URL)'
MESSAGE: 'Build failed! Check the pipeline logs.'
STATUS: 'failure'
WEBHOOK_FORMAT: 'discord'
Troubleshooting
Problem: HTTP 400 from Slack.
Solution: Use an Incoming Webhook URL (https://hooks.slack.com/services/...) and make sure WEBHOOK_FORMAT: slack. App-token-style URLs are not webhooks and will reject the payload.
Problem: Discord returns HTTP 204 but the message never appears in the channel.
Solution: 204 is Discord's success response: NOTIFY_RESULT will be sent. If the message is missing, the bot lacks "Send Messages" permission in the target channel.