Basic Lambda function that triggers a CodeGuru review from an SNS notification from a CodeCommit push
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.
-
Create an SNS topic configured to receive CodeCommit notifications.
-
Create a CodeCommit trigger for an Amazon SNS topic, checking the "Branches and tags... updated" box.
-
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.