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

Commit e6dbda5

Browse files
BosAtWorkjaymccon
authored andcommitted
Add support for bitbucket server 6.6.2
Sample json that bitbucket server 6.6.2 sends as hook { "eventKey":"repo:refs_changed", "date":"2020-01-14T16:30:45+0100", "actor":{ "name":"****", "emailAddress":"****", "id":8361, "displayName":"****", "active":true, "slug":"****", "type":"NORMAL", "links":{ "self":[ { "href":"****" } ] } }, "repository":{ "slug":"****", "id":2659, "name":"****", "scmId":"git", "state":"AVAILABLE", "statusMessage":"Available", "forkable":false, "project":{ "key":"****", "id":2264, "name":"****", "description":"****", "public":false, "type":"NORMAL", "links":{ "self":[ { "href":"****" } ] } }, "public":false, "links":{ "clone":[ { "href":"****.git", "name":"http" }, { "href":"ssh://git@****.git", "name":"ssh" } ], "self":[ { "href":"https://****/browse" } ] } }, "changes":[ { "ref":{ "id":"refs/heads/hotfix/transfer-should-be-checked", "displayId":"hotfix/transfer-should-be-checked", "type":"BRANCH" }, "refId":"refs/heads/hotfix/transfer-should-be-checked", "fromHash":"0000000000000000000000000000000000000000", "toHash":"4a24622fd85f304770079a8b4dbf9566ea1928c5", "type":"ADD" } ] }
1 parent a7c1f56 commit e6dbda5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

functions/source/GitPullS3/lambda_function.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ def lambda_handler(event, context):
193193
if(event['body-json']['push']['changes'][0]['new']['type'] == 'tag'):
194194
branch_name = 'tags/'+event['body-json']['push']['changes'][0]['new']['name']
195195
except:
196-
branch_name = 'master'
196+
# Bitbucket Server v6.6.1
197+
try:
198+
branch_name = event['body-json']['changes'][0]['ref']['displayId']
199+
except:
200+
branch_name = 'master'
197201
try:
198202
# GitLab
199203
remote_url = event['body-json']['project']['git_ssh_url']

0 commit comments

Comments
 (0)