3 Answers
- Newest
- Most votes
- Most comments
1
Hi mumbo,
Glad you could find a solution for your issue. Right now CodeCommit does not emit events for tag creation, so as you have already figured out, the right way to get what you want, given you know the tag name, is to just call CodeCommit to get the commit id using that tag reference.
answered 5 years ago
0
I think I found a way to do it.
Instead of trying to get the correct id from the CloudWatch event, I've used boto3 codecommit client in my Lambda function.
botoCodeCommitClient = boto3.client('codecommit')
botoCodeCommitClient.get_commit(repositoryName=repository, commitId=tagCommitId)
The result contains the correct commit id.
"commit": {
"commitId": "6a2359d64291a6490412a46de8d6566602e8f736",
"treeId": "72e8659841587e1afa59a775bafe9d6a5c8a8f5d",
"parents": ["8ccc13c43416850ac16105e789fc8db5911db11e"],
"message": "xxx",
"author": {
"name": "xxx",
"email": "xxx,
"date": "1557711827 +0000"
}
Edited by: mumbo on May 14, 2019 1:10 AM
answered 5 years ago
0
Hi robison,
I am planning to add the branch name to the artifact path on S3. Eg. /tags/<branchname>/<tagname>
Is there a way in boto3 to get the branch name of a given commit id?
Thanks
answered 5 years ago
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago