-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: atlassian-bitbucket-server-integration-plugin
-
Environment:atlassian-server-integration:4.0.0 git:5.2.1
Previously, the Bitbucket Server integration plugin set the GIT_BRANCH environment variable equal to the local branch name checked out by Jenkins. In versions of the plugin < 3.6.0 a multibranch pipeline's job named example/example-branch would have a GIT_BRANCH variable set to example-branch. After upgrading to 4.0.0 of the plugins, that same variable would be origin/example-branch. This is breaking a lot of our Jenkinsfiles that depend on the previous behavior.
Â
Example code
stage("Print GIT_BRANCH"){
  steps{
   echo env.GIT_BRANCH
  }
 }
Output on 3.6.0
aidaleuc/smoketests
Output on 4.0.0
origin/aidaleuc/smoketests