Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit 4a69d44

Browse files
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.
1 parent 1a804fe commit 4a69d44

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

functions/source/GitPullS3/lambda_function.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def lambda_handler(event, context):
190190
try:
191191
# Bibucket server
192192
branch_name = event['body-json']['push']['changes'][0]['new']['name']
193+
if(event['body-json']['push']['changes'][0]['new']['type'] == 'tag'):
194+
branch_name = 'tags/'+event['body-json']['push']['changes'][0]['new']['name']
193195
except:
194196
branch_name = 'master'
195197
try:

0 commit comments

Comments
 (0)