From 7610f28fdfa4f2b327e4bd8e2524bb2d310e61df Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Sat, 8 Jul 2023 17:49:10 +1000 Subject: [PATCH] feat: support Cirrus CI environment Relates to https://github.com/pact-foundation/pact-js/pull/1098 --- lib/pact_broker/client/git.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/client/git.rb b/lib/pact_broker/client/git.rb index 659f3bc..d12efd8 100644 --- a/lib/pact_broker/client/git.rb +++ b/lib/pact_broker/client/git.rb @@ -14,6 +14,7 @@ bamboo.repository.git.branch https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html BITBUCKET_BRANCH BITBUCKET_COMMIT https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html BUILD_SOURCEBRANCHNAME BUILD_SOURCEVERSION Azure +CIRRUS_BRANCH CIRRUS_CHANGE_IN_REPO https://cirrus-ci.org/guide/writing-tasks/#environment-variables =end # Keep in sync with pact-provider-verifier/lib/pact/provider_verifier/git.rb @@ -25,8 +26,8 @@ module Git using PactBroker::Client::HashRefinements COMMAND = 'git rev-parse --abbrev-ref HEAD'.freeze - BRANCH_ENV_VAR_NAMES = %w{GITHUB_HEAD_REF GITHUB_REF BUILDKITE_BRANCH CIRCLE_BRANCH TRAVIS_BRANCH GIT_BRANCH GIT_LOCAL_BRANCH APPVEYOR_REPO_BRANCH CI_COMMIT_REF_NAME BITBUCKET_BRANCH BUILD_SOURCEBRANCHNAME}.freeze - COMMIT_ENV_VAR_NAMES = %w{GITHUB_SHA BUILDKITE_COMMIT CIRCLE_SHA1 TRAVIS_COMMIT GIT_COMMIT APPVEYOR_REPO_COMMIT CI_COMMIT_ID BITBUCKET_COMMIT BUILD_SOURCEVERSION} + BRANCH_ENV_VAR_NAMES = %w{GITHUB_HEAD_REF GITHUB_REF BUILDKITE_BRANCH CIRCLE_BRANCH TRAVIS_BRANCH GIT_BRANCH GIT_LOCAL_BRANCH APPVEYOR_REPO_BRANCH CI_COMMIT_REF_NAME BITBUCKET_BRANCH BUILD_SOURCEBRANCHNAME CIRRUS_BRANCH}.freeze + COMMIT_ENV_VAR_NAMES = %w{GITHUB_SHA BUILDKITE_COMMIT CIRCLE_SHA1 TRAVIS_COMMIT GIT_COMMIT APPVEYOR_REPO_COMMIT CI_COMMIT_ID BITBUCKET_COMMIT BUILD_SOURCEVERSION CIRRUS_CHANGE_IN_REPO} BUILD_URL_ENV_VAR_NAMES = %w{BUILDKITE_BUILD_URL CIRCLE_BUILD_URL TRAVIS_BUILD_WEB_URL BUILD_URL } def self.commit