I want to send AWS CodeCommit commit message to a HipChat room. I already have a lambda function which gets triggered for a particular commit. What I need is to get commit detail messages from CodeCommit. Commit ID, commit message, branch name etc.
Asked
Active
Viewed 95 times
1 Answers
1
Inside lambda you can require sdk then get parameters from lambda event.
const AWS = require('aws-sdk')
let codecommit = new AWS.CodeCommit();
var params = {
commitId: 'STRING_VALUE', /* required */
repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getCommit(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Depending on the info you get in lambda event parameters you can call one of those methods from sdk.
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CodeCommit.html

owais
- 4,752
- 5
- 31
- 41