I\'m trying to get the name of my branch for a jenkins groovy script. I cannot get the current branch name. I try the following:
stage(\'Check out code\') ch
In the pipeline job I'm using env.GIT_BRANCH which resolves to origin/{BRANCH}
env.GIT_BRANCH
origin/{BRANCH}
In the case of a multibranch job, env.GIT_BRANCH resolves to {BRANCH} (no origin/).
{BRANCH}
origin/