Examples
Slack Notifications
Send real-time pipeline status updates and deployment alerts to Slack channels.
Simple Notification
Notify a channel when a deployment succeeds:
json
{
"name": "deploy-notify",
"steps": [
{
"id": "deploy",
"type": "shell",
"config": {
"command": "kubectl rollout restart deployment/myapp"
}
},
{
"id": "notify_success",
"type": "slack.notify",
"config": {
"webhook_url": "{{env.SLACK_WEBHOOK_URL}}",
"message": ":white_check_mark: *{{env.CI_PROJECT_NAME}}* deployed to production by {{env.GITLAB_USER_LOGIN}}"
},
"depends_on": ["deploy"]
}
]
}Pipeline Status with Jira Link
Include a Jira review button in the Slack message:
json
{
"name": "pipeline-status",
"steps": [
{
"id": "run_tests",
"type": "shell",
"config": { "command": "go test ./..." }
},
{
"id": "notify",
"type": "slack.notify",
"config": {
"webhook_url": "{{env.SLACK_WEBHOOK_URL}}",
"message": ":test_tube: Tests passed for branch *{{env.CI_COMMIT_REF_NAME}}*",
"action_url": "{{env.CI_PIPELINE_URL}}",
"action_text": "View Pipeline"
},
"depends_on": ["run_tests"]
}
]
}Setup
Create an Incoming Webhook in your Slack workspace and pass the URL as an environment variable:
bash
# Set in CI/CD secrets or .env
export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T.../B.../...
# Run with Docker
docker run --rm \
-v $(pwd):/workspace -w /workspace \
-e SLACK_WEBHOOK_URL=$SLACK_WEBHOOK_URL \
ghcr.io/rajitk13/shiro-automation:latest \
shiro runslack.notify config reference
| Field | Required | Description |
|---|---|---|
| webhook_url | Yes | Slack Incoming Webhook URL |
| message | Yes | Message body (supports Slack mrkdwn) |
| action_url | No | URL for the action button |
| action_text | No | Button label (default: "Review in GitLab") |