This notifier uses Slack Webhooks to send notifications to your Slack workspace.
This notifier runs as a container via Google Cloud Run and responds to events that Cloud Build publishes via its Pub/Sub topic.
For detailed instructions on setting up this notifier, see Configuring Slack notifications.
This notifier expects the following fields in the delivery
map to be set:
webhook_url
: ThesecretRef: <Slack-webhook-URL>
map that references the Slack webhook URL resource path in thesecrets
section.
Please do not upgrade to 1.15 as it contains bindings/templating functionality which may break existing slack setups below 1.15. Official documentation will be released detailing usage for bindings/templating, but for now the feature is in alpha so existing users are recommended to use releases older than 1.15.
You can specify the slack version like so:
gcloud run deploy service-name \
--image=us-east1-docker.pkg.dev/gcb-release/cloud-build-notifiers/slack:slack-1.14.0 \
--no-allow-unauthenticated \
--update-env-vars=CONFIG_PATH=config-path,PROJECT_ID=project-id
- The
replace
function allows replacement of substrings in any {{template variables}} in the .json Slack template. (For example, the variable.Build.FailureInfo.Detail
contains double quotes, which breaks the BlockKitTemplate parsing.)- Usage:
{{replace .Build.FailureInfo.Detail "\"" "'"}}
- Usage: