Skip to content

Commit

Permalink
feat: add BITBUCKET_BRANCH to list of known branch variables (pact-fo…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock authored May 9, 2020
1 parent d34e55f commit d1dc088
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pact_broker/client/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CI_COMMIT_REF_NAME https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
CI_BRANCH CI_COMMIT_ID https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/
bamboo.repository.git.branch https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html
BITBUCKET_BRANCH https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html
=end

Expand All @@ -19,7 +20,7 @@ module PactBroker
module Client
module Git
COMMAND = 'git name-rev --name-only HEAD'.freeze
BRANCH_ENV_VAR_NAMES = %w{BUILDKITE_BRANCH CIRCLE_BRANCH TRAVIS_BRANCH GIT_BRANCH GIT_LOCAL_BRANCH APPVEYOR_REPO_BRANCH CI_COMMIT_REF_NAME}.freeze
BRANCH_ENV_VAR_NAMES = %w{BUILDKITE_BRANCH CIRCLE_BRANCH TRAVIS_BRANCH GIT_BRANCH GIT_LOCAL_BRANCH APPVEYOR_REPO_BRANCH CI_COMMIT_REF_NAME BITBUCKET_BRANCH}.freeze

def self.branch
find_branch_from_env_vars || branch_from_git_command
Expand Down

0 comments on commit d1dc088

Please sign in to comment.