[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eCloud Build notifiers are Docker images that run as containers on Cloud Run, delivering build event updates and metadata via push subscriptions to services like Slack or SMTP.\u003c/p\u003e\n"],["\u003cp\u003eThese notifiers listen to the \u003ccode\u003ecloud-builds\u003c/code\u003e Pub/Sub topic, filter messages, and route notifications through Cloud Run to the configured service, using a common YAML configuration stored in Cloud Storage and credentials in Secret Manager.\u003c/p\u003e\n"],["\u003cp\u003eCloud Build maintains several deployable notifier images, including those for BigQuery, GitHub Issues, Google Chat, HTTP, Slack, and SMTP, all available in the \u003ccode\u003ecloud-build-notifiers\u003c/code\u003e repository.\u003c/p\u003e\n"],["\u003cp\u003eYou can use a provided setup script to automate the configuration of Cloud Build's supported notifiers.\u003c/p\u003e\n"],["\u003cp\u003eYou are able to create custom notifiers by utilizing the \u003ccode\u003ecloud-build-notifiers\u003c/code\u003e repository's library.\u003c/p\u003e\n"]]],[],null,["# Cloud Build notifiers are Docker images that can be run as\ncontainers on Cloud Run. When polled by a subscriber application,\nCloud Build notifiers use\n[push subscriptions](/build/docs/subscribe-build-notifications#push)\nto deliver messages to a configured service, such as Slack or an SMTP server.\n\nThis page provides an overview of Cloud Build notifiers.\n\nCloud Build notifiers\n---------------------\n\nCloud Build sends all build event updates, along with build metadata,\n[to Pub/Sub](/build/docs/subscribe-build-notifications) on either the\n`cloud-builds` topic or a user-defined topic. Cloud Build\nnotifiers can be configured to listen to that topic, filter the messages it\nreceives, and send messages to your service through Cloud Run.\n\nAll notifiers use a common YAML spec for configuration, stored in\nCloud Storage. If your chosen service requires authentication,\nthen its credentials are stored in Secret Manager.\nCloud Run routes your message and sends your notifications to\nyour service.\n\nThe following diagram shows how Cloud Build\ninteracts with other Google Cloud products, such\nas Pub/Sub and Cloud Run, to send\nnotifications:\n\nPub/Sub topics for build notifications\n--------------------------------------\n\nBy default, Cloud Build sends build notifications to\na Pub/Sub topic named `cloud-builds` if one exists. You can also\n[create a custom Pub/Sub topic](/pubsub/docs/create-topic) to\nreceive build notifications. In your build config file, the\n[`options.pubsubTopic`](/build/docs/build-config-file-schema#pubsub-topic)\nfield defines the name of the topic that\nCloud Build sends notifications to:\n\n- If `options.pubsubTopic` is left blank,\n then Cloud Build uses a default value of `cloud-builds` as the\n topic name for builds from that file. As a result, if you create a\n `cloud-builds` topic and leave `options.pubsubTopic` undefined in all your\n build config files, then that topic receives all your build notifications.\n\n- If you specify a custom topic name in `options.pubsubTopic`, then\n Cloud Build sends notifications for that build config\n file to that topic. Custom topic names are useful when you don't want\n all of your build notifications published to the same topic.\n\n When you use a custom topic name in a build config file, you must also\n assign the `roles/pubsub.publisher` role to any service account other than\n the default Cloud Build service account.\n\n| **Warning:** We strongly recommend using different topics for [Pub/Sub](/build/docs/automate-builds-pubsub-events?generation=2nd-gen) triggers and build notifications. Otherwise, notifications might turn into trigger events again, resulting in a recurring cycle of notifications and trigger events.\n\n**Publish build notifications to Pub/Sub topics across projects**\n\nTo publish build notifications to a Pub/Sub topic in a different\nproject from where the build was executed, provide the\n`roles/pubsub.publisher` role to the service account in the target project.\n\nFor example, you have Project A and Project B. You execute a build\nin Project A using Service Account A, and you want to publish build\nnotifications to a Pub/Sub topic in Project B. To do so,\nyou could grant Service Account A the `roles/pubsub.publisher` role in\nProject B by running the following command: \n\n gcloud projects add-iam-policy-binding ProjectB --member 'serviceAccount:ServiceAccountA' --role 'roles/pubsub.publisher'\n\nYou could then use a build config such as the following, which lets\nyou execute a build in Project A and publish build notifications to Project B: \n\n steps:\n - name: ubuntu\n args:\n - pwd\n serviceAccount: projects/ProjectA/serviceAccounts/ServiceAccountA\n options:\n pubsubTopic: projects/ProjectB/topics/CustomTopic\n logging: desired-logging-option\n\nSupported notifiers provided by Cloud Build\n-------------------------------------------\n\nCloud Build provides and maintains deployable notifier images in\nthe [`cloud-build-notifiers` repository](http://github.com/GoogleCloudPlatform/cloud-build-notifiers). The following table lists available\nnotifiers:\n\nTo learn more about how to configure each notifier, see the\ncorresponding page for each service:\n\n- [Configure BigQuery notifications](/build/docs/configuring-notifications/configure-bigquery)\n- [Configure GitHub Issues notifications](/build/docs/configuring-notifications/configure-githubissues)\n- [Configure Google Chat notifications](/build/docs/configuring-notifications/configure-googlechat)\n- [Configure HTTP notifications](/build/docs/configuring-notifications/configure-http)\n- [Configure Slack notifications](/build/docs/configuring-notifications/configure-slack)\n- [Configure SMTP notifications](/build/docs/configuring-notifications/configure-smtp)\n\nAutomate notification configuration\n-----------------------------------\n\nCloud Build provides a [setup script](https://github.com/GoogleCloudPlatform/cloud-build-notifiers/blob/master/setup.sh)\nthat you can use to automate notification configuration for\n[Cloud Build supported notifiers](/build/docs/configuring-notifications/notifiers#supported_notifiers).\n\nTo learn how to configure notifications for\n[Cloud Build supported notifiers](/build/docs/configuring-notifications/notifiers),\nsee [Automating configuration for notifications](/build/docs/configuring-notifications/automate).\n\nCreate your own notifier\n------------------------\n\nIn addition to notifiers maintained by Cloud Build,\nsuch as [Slack](/build/docs/configuring-notifications/configure-slack)\nor [SMTP](/build/docs/configuring-notifications/configure-smtp),\nyou can use the provided library in the [`cloud-build-notifiers` repository](http://github.com/GoogleCloudPlatform/cloud-build-notifiers) to create your own notifier.\n\nTo learn how to create your own notifier, see [Creating your own notifier](/build/docs/configuring-notifications/create-notifier).\n\nWhat's next\n-----------\n\n- Learn how to configure [BigQuery](/build/docs/configuring-notifications/configure-bigquery), [GitHub Issue](/build/docs/configuring-notifications/configure-githubissues), [Google Chat](/build/docs/configuring-notifications/configure-googlechat), [HTTP](/build/docs/configuring-notifications/configure-http), [Slack](/build/docs/configuring-notifications/configure-slack), or [SMTP](/build/docs/configuring-notifications/configure-smtp) notifiers.\n- Learn how to [automate configuration for\n notifications](/build/docs/configuring-notifications/automate).\n- Learn how to [create your own notifier](/build/docs/configuring-notifications/create-notifier)."]]