From 4a69d44bbb663d73e97cfc1c71f939d963861007 Mon Sep 17 00:00:00 2001 From: Francisco Memoli Date: Tue, 17 Mar 2020 19:00:22 -0300 Subject: [PATCH] Support bitbucket tags on git pull option I found an error when someone push a tag to bitbucket because the path where we execute the pull is incorrect formed like it would be a regular branch. I added an if checking the type of change that comes in the json form bitbucket, if the type is "tag" I add to the "branch_name" "tags/". This will be used on the pull_repo method to form the reference correctly. --- functions/source/GitPullS3/lambda_function.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/source/GitPullS3/lambda_function.py b/functions/source/GitPullS3/lambda_function.py index 4686be2..7b6ab81 100644 --- a/functions/source/GitPullS3/lambda_function.py +++ b/functions/source/GitPullS3/lambda_function.py @@ -190,6 +190,8 @@ def lambda_handler(event, context): try: # Bibucket server branch_name = event['body-json']['push']['changes'][0]['new']['name'] + if(event['body-json']['push']['changes'][0]['new']['type'] == 'tag'): + branch_name = 'tags/'+event['body-json']['push']['changes'][0]['new']['name'] except: branch_name = 'master' try: