Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added bitbucket webhook support for pull request event #540

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions templates/webhook.bin.erb
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@ class Server < Sinatra::Base

# Iterate the data structure to determine what's should be deployed
branch = (
data['ref'] || # github & gitlab
data['refChanges'][0]['refId'] rescue nil || # stash
data['push']['changes'][0]['new']['name'] rescue nil || # bitbucket
data['changes'][0]['ref']['displayId'] rescue nil || # bitbucket server native
data['resource']['refUpdates'][0]['name'] rescue nil || # TFS/VisualStudio-Git
data['repository']['default_branch'] # github tagged release; no ref.
data['ref'] || # github & gitlab
data['refChanges'][0]['refId'] rescue nil || # stash
data['push']['changes'][0]['new']['name'] rescue nil || # bitbucket
data['changes'][0]['ref']['displayId'] rescue nil || # bitbucket server repository event
data['pullRequest']['fromRef']['displayId'] rescue nil || # bitbucket server pull request event
data['resource']['refUpdates'][0]['name'] rescue nil || # TFS/VisualStudio-Git
data['repository']['default_branch'] # github tagged release; no ref.
).sub('refs/heads/', '') rescue nil

# If prefix is enabled in our config file, determine what the prefix should be
Expand Down