跳到主要内容

Slack Notification with YAML

List of YAML parameters and examples for the "Slack Notification" action

YAML parameters for Slack Notification

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Should be set to SLACK.
channel
必填
StringThe ID of the Slack channel. More info here.
integration_hash
必填
StringThe ID of the integration.
content
必填
StringThe content of the notification.
attachmentsString[]The array of the Slack message attachments. More info here.
file_attachmentsString[]The attached files.

YAML example for Slack Notification

actions:
- action: "Send notification to deploys channel"
type: "SLACK"
content: "[#${BUDDY_EXECUTION_ID}] ${BUDDY_PIPELINE_NAME} execution by <${BUDDY_INVOKER_URL}|${BUDDY_INVOKER_NAME}>"
channel: "C0GAADCCL"
attachments:
- "{\"fallback\":\"${BUDDY_PIPELINE_NAME} execution #${BUDDY_EXECUTION_ID}\",\"color\":\"${good}\",\"fields\":[{\"title\":\"Successful execution\",\"value\":\"<${BUDDY_EXECUTION_URL}|Execution #${BUDDY_EXECUTION_ID} ${BUDDY_EXECUTION_COMMENT}>\",\"short\":true},{\"title\":\"Pipeline\",\"value\":\"<${BUDDY_PIPELINE_URL}|${BUDDY_PIPELINE_NAME}>\",\"short\":true},{\"title\":\"Branch\",\"value\":\"${BUDDY_EXECUTION_BRANCH}\",\"short\":true},{\"title\":\"Project\",\"value\":\"<${BUDDY_PROJECT_URL}|${BUDDY_PROJECT_NAME}>\",\"short\":true}]}"
integration_hash: "5ddb7c180fb38be67bd78a88a"
variables:
- key: "color"
value: "good"
file_attachments:
- "fs:///file1"
- "fs:///file2"