{"id":13850051,"url":"https://github.com/Philmod/google-cloud-build-slack","last_synced_at":"2025-07-12T21:32:49.720Z","repository":{"id":145516188,"uuid":"85432326","full_name":"Philmod/google-cloud-build-slack","owner":"Philmod","description":"Slack integration for Google Cloud Container Builder, using Google Cloud Functions","archived":false,"fork":false,"pushed_at":"2020-09-30T17:44:52.000Z","size":94,"stargazers_count":79,"open_issues_count":10,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-19T13:53:57.432Z","etag":null,"topics":["cloud","google","slack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Philmod.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}},"created_at":"2017-03-18T21:12:01.000Z","updated_at":"2024-08-23T02:48:34.000Z","dependencies_parsed_at":"2023-05-29T21:45:49.311Z","dependency_job_id":null,"html_url":"https://github.com/Philmod/google-cloud-build-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/Philmod%2Fgoogle-cloud-build-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philmod%2Fgoogle-cloud-build-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philmod%2Fgoogle-cloud-build-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philmod%2Fgoogle-cloud-build-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Philmod","download_url":"https://codeload.github.com/Philmod/google-cloud-build-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225839485,"owners_count":17532305,"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":["cloud","google","slack"],"created_at":"2024-08-04T20:00:57.423Z","updated_at":"2024-11-22T03:30:41.166Z","avatar_url":"https://github.com/Philmod.png","language":"JavaScript","funding_links":[],"categories":["Cloud Functions"],"sub_categories":[],"readme":"# google-cloud-build-slack\n\nSlack integration for Google Cloud Build, using Google Cloud Functions to post messages to Slack when a build reaches a specific state.\n\n## Setup\n\n1. Create a Slack app, and copy the webhook URL:\n```\nexport SLACK_WEBHOOK_URL=my-slack-webhook-url\n```\n2. Set the `PROJECT_ID` variable:\n```\nexport PROJECT_ID=my-project-id\n```\n3. [Optionally] Set a github token to obtain github commit author info in slack messages if applicable. Please refer to the [current limitations](#limitations).\n```\nexport GITHUB_TOKEN=my-token\n```\n4. [Optionally] Set the status you want a message for, here are the default ones:\n```\nexport GC_SLACK_STATUS=\"SUCCESS FAILURE TIMEOUT INTERNAL_ERROR\"\n```\n5. Create the function with [setup.sh (Option 1)](#script) OR [serverless framework (Option 2)](#serverless)\n\n\u003ca name=\"script\"/\u003e\u003c/a\u003e\n### Option 1: Deploy with script\n- [Optionally] Set a specific `BUCKET_NAME` and a `FUNCTION_NAME`.\n- Create the function:\n```\n. ./setup.sh\n# OR\nnpm run setup\n```\n\u003ca name=\"serverless\"/\u003e\u003c/a\u003e\n### Option 2: Deploy with serverless framework\n1. Install `serverless`\n```\nnpm install serverless -g\n```\n2. Ensure that the value of `project.credentials` in `serverless.yml` points to [credentials with appropriate roles Serverless can use to create resources in your Project](https://serverless.com/framework/docs/providers/google/guide/credentials#get-credentials--assign-roles).\n\n3. [Deploy](https://serverless.com/framework/docs/providers/google/cli-reference/deploy/)\n```\nserverless deploy\n```\n\n## Teardown\n\n### If deployed with script\nThe teardown script will delete the function `FUNCTION_NAME`, and the bucket `BUCKET_NAME`.\n```\n. ./teardown.sh\n# OR\nnpm run teardown\n```\n\n### If deployed with serverless framework\n[Remove](https://serverless.com/framework/docs/providers/google/cli-reference/remove/)\n```\nserverless remove\n```\n\n## FAQ\n\n### How much does it cost?\nEach build invokes 3 times the function:\n- when the build is queued\n- when the build starts\n- when the build reaches a final status.\n\nHere is the [GCF pricing](https://cloud.google.com/functions/pricing) for calculation.\n### Can I use an existing bucket?\nYes if [deploying with the setup script](#script), specify the `BUCKET_NAME`:\n```\nexports BUCKET_NAME=my-bucket\n```\n\nIf [deploying with the serverless framework](#serverless) however, this option is not yet available in the [Google Cloud Functions provider plugin](https://github.com/serverless/serverless-google-cloudfunctions), but hopefully will be in the near future as [an issue has been opened](https://github.com/serverless/serverless-google-cloudfunctions/issues/158).\n\n### How can I update a function?\nIf you use the setup script with the same `FUNCTION_NAME`, it will update the existing function.\n\nIf you use serverless, simply re running `serverless deploy` will update the existing function.\n\n### Where can I find the `SLACK_WEBHOOK_URL`?\nAfter creating an application on Slack, active the Incoming Webhooks. You'll find the url on that page:\n![slack webhook](https://cldup.com/aQVqcFCuAH.png)\n\n### Why do I have to source the script?\nIn the case where a `BUCKET_NAME` is not defined, a random one is generated. And in order to delete it during the teardown, the variable has to be exported from the setup script.\n\n\u003ca name=\"limitations\"/\u003e\u003c/a\u003e\n\n### What are the limitations of using github token to get github commit author info?\n\nFor github commit author info to be displayed, the cloud source repositories must be in the form of `github_\u003cOWNER\u003e_\u003cREPO\u003e` and there cannot be underscores in either `\u003cOWNER\u003e` or `\u003cREPO\u003e`. A possible solution to bypass this limitation would be to retrieve owner and repo info directly from [GitHubEventsConfig](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.triggers#githubeventsconfig).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilmod%2Fgoogle-cloud-build-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPhilmod%2Fgoogle-cloud-build-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilmod%2Fgoogle-cloud-build-slack/lists"}