/codeguru-trigger-lambda

Basic Lambda function that triggers a CodeGuru review from an SNS notification from a CodeCommit push

Primary LanguagePython

codeguru-trigger-lambda

Basic Lambda function that triggers a CodeGuru review from an SNS notification from a CodeCommit push

Code style: black Imports: isort

This example shows how to automatically trigger a CodeGuru Code Review on a push (rather than just on a pull request). You just need to follow a couple basic steps to enable push notifications on the repo and create a Lambda function that will subscribe to the notifications and trigger a CodeGuru review for the given repo / branch.

  1. Create an SNS topic configured to receive CodeCommit notifications.

  2. Create a CodeCommit trigger for an Amazon SNS topic, checking the "Branches and tags... updated" box.

  3. Write a Lambda function to take the SNS message and trigger the CodeGuru review. The function will need an execution role that can read the SNS topic and make the CodeGuru calls. I have provided sample code here to get you started.