{"id":18790666,"url":"https://github.com/onsails/cloudbuild-slack","last_synced_at":"2025-04-13T14:13:10.450Z","repository":{"id":36984055,"uuid":"259439149","full_name":"onsails/cloudbuild-slack","owner":"onsails","description":"Google Cloud Build notifications in Slack using Cloud Function","archived":false,"fork":false,"pushed_at":"2025-04-08T10:32:02.000Z","size":458,"stargazers_count":12,"open_issues_count":30,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T14:13:05.063Z","etag":null,"topics":["google-cloud-build","google-cloud-platform","google-pubsub","slack","slack-webhook"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onsails.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-27T20:04:52.000Z","updated_at":"2024-06-05T08:39:53.000Z","dependencies_parsed_at":"2024-01-14T02:39:48.560Z","dependency_job_id":"fb3cd5d2-33c8-4494-af3d-821751a3ac35","html_url":"https://github.com/onsails/cloudbuild-slack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onsails%2Fcloudbuild-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onsails%2Fcloudbuild-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onsails%2Fcloudbuild-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onsails%2Fcloudbuild-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onsails","download_url":"https://codeload.github.com/onsails/cloudbuild-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724628,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-cloud-build","google-cloud-platform","google-pubsub","slack","slack-webhook"],"created_at":"2024-11-07T21:13:13.271Z","updated_at":"2025-04-13T14:13:10.406Z","avatar_url":"https://github.com/onsails.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# Google Cloud Function sending Cloud Build statuses to a Slack channel, written in TypeScript\n\nFeatures:\n\n- [x] send slack notifications about successful and failed builds;\n- [x] link to build details in slack message;\n- [x] no need in additional step in cloudbuild.yaml;\n- [x] report success and failure statuses;\n- [ ] show trigger information in slack message;\n- [x] customize slack message using substitution in cloudbuild.yaml.\n\n![Slack message](https://github.com/onsails/cloudbuild-slack/raw/master/screenshot.png \"Slack message\")\n![Slack message](https://github.com/onsails/cloudbuild-slack/raw/master/screenshot-fail.png \"Slack message\")\n\n# Deploy\n\nPrerequisites:\n\n* Google Cloud Platform project with enabled Cloud Functions API;\n* gcloud command-line util authorized to deploy cloud functions;\n* Slack webhook url.\n\nDeployment:\n\n```bash\nSLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR_TOKENS ./deploy.sh\n```\n\nThis script will deploy cloud function `gcbSubscribeSlack` triggered by `cloud-build` PubSub topic.\n\nMessage content can be (optionally) defined by `_SLACK_MESSAGE_TEMPLATE` substitution in cloudbuild.yaml. Value should be a valid [ejs](https://ejs.co) template:\n\n```yaml\nsteps:\n\n# ... build steps ...\n\nsubstitutions:\n  _SLACK_MESSAGE_TEMPLATE: '\u003c%= emoji %\u003e *https://\u003c%= build.substitutions._OVERLAY %\u003e.example.com* frontend build \u0026 deploy `\u003c%= build.id %\u003e` \u003c%= build.status %\u003e'\n```\n\n`emoji` corresponds to a build status, `build` is object containing build information, it's structure is defined [here](https://github.com/onsails/cloudbuild-slack/blob/master/src/pubsub.ts).\n\nThe default message template is ```\u003c%= emoji %\u003e `\u003c%= build.id %\u003e` \u003c%= build.status %\u003e```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsails%2Fcloudbuild-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonsails%2Fcloudbuild-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsails%2Fcloudbuild-slack/lists"}