YAML for Slack notification
Send a message to a Slack channel. Supports attachments, blocks, and file uploads.
YAML examples for Slack notification
Slack notification with attachments
yaml- action: Notify team on Slack type: SLACK trigger_time: ON_EVERY_EXECUTION disabled: false integration: slack-integration content: |- Deployment to *$BUDDY_EXECUTION_BRANCH* completed! Revision: `$BUDDY_EXECUTION_REVISION` Triggered by: $BUDDY_INVOKER_NAME blocks: '[{"type":"section","fields":[{"type":"mrkdwn","text":"*Status:* Deployed"},{"type":"mrkdwn","text":"*Branch:* $BUDDY_EXECUTION_BRANCH"}]}]' channel: "#deployments" attachments: - '{"color":"good","title":"Build Successful","text":"All tests passed"}' - '{"color":"#36a64f","title":"Deployment Info","fields":[{"title":"Environment","value":"Production","short":true}]}' file_attachments: - /logs/build.log - /reports/test-results.xml ignore_errors: false retry_interval: 30 retry_count: 2 timeout: 60
Simple Slack notification
yaml- action: Slack notify type: SLACK trigger_time: ON_EVERY_EXECUTION integration: slack-integration content: Build completed channel: "#general"