{"id":16584929,"url":"https://github.com/mikaelvesavuori/codecommit-slack-bot","last_synced_at":"2026-04-18T11:08:04.071Z","repository":{"id":101080844,"uuid":"401366897","full_name":"mikaelvesavuori/codecommit-slack-bot","owner":"mikaelvesavuori","description":"Simple serverless Slack bot for notifying about AWS CodeCommit events.","archived":false,"fork":false,"pushed_at":"2021-09-11T13:35:31.000Z","size":354,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T23:51:51.504Z","etag":null,"topics":["aws","ci-cd","codecommit","notifications","serverless","slack","slack-bot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/mikaelvesavuori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-08-30T14:09:19.000Z","updated_at":"2021-09-11T13:35:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9e664e5-75b5-4ca8-92f4-9d3e956d8b12","html_url":"https://github.com/mikaelvesavuori/codecommit-slack-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikaelvesavuori/codecommit-slack-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fcodecommit-slack-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fcodecommit-slack-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fcodecommit-slack-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fcodecommit-slack-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaelvesavuori","download_url":"https://codeload.github.com/mikaelvesavuori/codecommit-slack-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fcodecommit-slack-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws","ci-cd","codecommit","notifications","serverless","slack","slack-bot"],"created_at":"2024-10-11T22:46:14.389Z","updated_at":"2026-04-18T11:08:04.043Z","avatar_url":"https://github.com/mikaelvesavuori.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeCommit Slack notification bot\n\n**Simple serverless Slack bot for notifying about AWS CodeCommit events.**\n\nIf you want smooth and easy notifications of what's going on in CodeCommit you have maybe found out that it's a bit limited right off the bat. However, since CodeCommit can use SNS and SNS in turn has a lot of possible targets, it's pretty simple to set up a Slack integration.\n\nOne benefit on a \"self-made\" integration, as opposed to the AWS Chatbot solution, is that you have complete control in this case and don't have to give AWS any permissions etc.\n\n![Diagram](./docs/diagram.png)\n\nThis project uses [Serverless Framework](https://www.serverless.com) to deploy the actual Lambda function, and the SNS topic you will have to do by hand (instructions provided below!). It is expected that you already have some CodeCommit repo up and running.\n\n## Prerequisites\n\n- AWS account and logged in through environment\n- High enough credentials in AWS to create services like SNS and Lambda\n- Node 14 or later installed\n- Administrator rights in Slack\n\n## How it can look like in Slack\n\n![Demo of notifications in Slack](./docs/demo.png)\n\n## Instructions\n\n### Slack\n\n- Go to the [API docs](https://api.slack.com)\n- Click `Create an app`\n- Click `From scratch`\n- Give it a name and workspace\n- Select `Incoming Webhooks: Post messages from external sources into Slack`\n- Toggle the switch to the `On` mode\n- Click `Add New Webhook to Workspace`\n- Select the channel you want the bot to write to; then allow it\n- Copy the hook URL and paste the part that looks like `/services/RANDOM/RANDOM/LONG_RANDOM` into `serverless.yml` under the `provider.environment.SLACK_HOOK_PATH` key\n\n### Code editor\n\n- Install dependencies with `npm install` or `yarn`\n- Deploy with `sls deploy`\n- When it's deployed you'll receive an endpoint: copy that down and use it in case you want to manually call the function\n\n### AWS\n\n- Create a standard SNS topic called `slackbot`. You are welcome to change this if you want, but in that case you'll also need to update the policy. Use the provided policy (`policy.json`) exchanging the bogus account number and region for your values. Note that the policy is fairly wide, but this shouldn't be too much of a security concern... KMS is also disabled. All these aspects are set up this way because CodeCommit can be really finicky to get going :/\n- Add a subscription in SNS with the Lambda function as a subscriber to the topic you created.\n- Create a notification rule on your CodeCommit repository. Add any events you are interested in. As the target, set your newly-created SNS topic.\n\nDone!\n\n## CodeCommit notification events\n\nThis codebase supports all eleven CodeCommit events:\n\n### Comments\n\n- On commits\n- On pull requests\n\n### Approvals\n\n- Status changed\n- Rule override\n\n### Pull request\n\n- Source updated\n- Created\n- Status changed\n- Merged\n\n### Branches and tags\n\n- Created\n- Deleted\n- Updated\n\n## Using the service\n\n_Note that the service/bot does not by default log anything, so add any `console.log()`s or whatever as you need, if you need them._\n\n### Live\n\nStart doing things to your CodeCommit repository and Slack should begin to display messages.\n\n### Using test data\n\nYou can use one of the eleven provided NPM scripts to send test data to your local offline endpoint. Just substitute your local URL for your remote URL if you want to run the remote instead.\n\nFor all of the below, add `npm run` or `yarn run` in front of the command.\n\nThe commands are:\n\n- `event:comment:commit`\n- `event:comment:pr`\n- `event:pr:approval:overridden`\n- `event:pr:approval:changed`\n- `event:pr:created`\n- `event:pr:merge:updated`\n- `event:pr:source:updated`\n- `event:pr:changed`\n- `event:ref:updated:merge`\n- `event:ref:updated`\n- `event:ref:deleted`\n\n## References\n\n- [Slack API docs](https://api.slack.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fcodecommit-slack-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaelvesavuori%2Fcodecommit-slack-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fcodecommit-slack-bot/lists"}