I would like to access GitHub.CommitMessage during AWS CodeDeploy (as a part of AWS CodePipeline) phase in my EC2 Instance.
Additional details:
- private repo inside organization
How can I do it?
Someone has already answered how to get the git commit Id . basically,
get the deployment id from DEPLOYMENT_ID environment variable
make an api call to GetDeployment api end point with the deployment id to get the commit details
now to get the commit message, github has a get commit api end point. This step requires a github access token
GET /repos/:owner/:repo/commits/:ref
reference: aws codedeploy git revision during deploy