Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to include the git message in AWS CodeCommit Push Trigger Notifications?

I have a codecommit repo.

I have a push trigger setup with a "Send to" = "Amazon SNS".

At SNS, I have some email subscribers hooked up to the notification event.

As a result, the project developers receive an email each time any developer executes a git push against the repo.

The email looks similar to:

enter image description here


Is there a way to add the git push or commit message in that notification?

like image 874
Brian Webster Avatar asked May 19 '17 14:05

Brian Webster


1 Answers

While that information is not provided directly from the trigger payload, it does provide a list of reference updates. Each new/updated reference (often a branch) contains the commit ID. If you were to configure an AWS Lambda trigger, you could get these commit IDs from the trigger payload, then use them with CodeCommit's 'GetCommit' api to retrieve the commit message. Then you could send your new payload to SNS for emailing.

Information on GetCommit: http://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetCommit.html

Example Lambda trigger setup with AWS CodeCommit: http://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify-lambda.html

like image 134
David Jackson Avatar answered Sep 25 '22 06:09

David Jackson