Discord with YAML

YAML parameters for Discord

You can find the list with common parameters for all Buddy actions here.

NameTypeDescription
notification_url
Required
StringThe URL do the desired Discord webhook.
name
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to DISCORD.
contentStringThe content of the notification.
attachmentsStringThe embedded rich content. More info here.
run_only_on_first_failureBooleanDefines whether the action should be executed on each failure. Restricted to and required if the trigger_time is ON_FAILURE.
variablesVariable []The list of variables defined for this action.
trigger_conditionStringDefines when the build action should be run. Can be one of ALWAYS, ON_CHANGE, ON_CHANGE_AT_PATH, VAR_IS, VAR_IS_NOT or VAR_CONTAINS or VAR_NOT_CONTAINS.
file_attachmentsString[]The attached files.

YAML example for Discord

actions:
- action: "Send notification to Discord"
type: "DISCORD"
notification_url: "https://discordapp.com/api/webhooks/45379791241512375553/zi3NxdcB6yFfa215n6UN8kece312392-u1BpaBUc2CYWoBMrrIJpK7t5lBr5nxFUqc9v9eKX8"
content: "[#$BUDDY_EXECUTION_ID] $BUDDY_PIPELINE_NAME by $BUDDY_INVOKER_NAME"
attachments:
- "{\"title\":\"Details\",\"url\":\"$BUDDY_EXECUTION_URL\",\"fields\":[{\"name\":\"Status\",\"value\":\"Successful execution\"},{\"name\":\"Revision\",\"value\":\"$BUDDY_EXECUTION_REVISION\"},{\"name\":\"Pipeline\",\"value\":\"$BUDDY_PIPELINE_NAME\"},{\"name\":\"Project\",\"value\":\"$BUDDY_PROJECT_NAME\"}]}"
file_attachments:
- "fs:///file1"
- "fs:///file2"
trigger_condition: "ALWAYS"