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

Commit bcbcba6

Browse files
committed
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 1a804fe commit bcbcba6

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
@@ -191,7 +191,11 @@ def lambda_handler(event, context):
191191
# Bibucket server
192192
branch_name = event['body-json']['push']['changes'][0]['new']['name']
193193
except:
194-
branch_name = 'master'
194+
# Bitbucket Server v6.6.1
195+
try:
196+
branch_name = event['body-json']['changes'][0]['ref']['displayId']
197+
except:
198+
branch_name = 'master'
195199
try:
196200
# GitLab
197201
remote_url = event['body-json']['project']['git_ssh_url']

0 commit comments

Comments
 (0)