Skip to content

Commit 374dec5

Browse files
committed
[releng] fix branch name extraction during build
1 parent 235af78 commit 374dec5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Jenkinsfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ try {
2020

2121
stage('Checkout repository') {
2222

23-
checkout scm
23+
scmVars = checkout scm
2424

2525
pom = readMavenPom file: 'pom.xml'
2626
currentVersion = pom.version
2727
revision = sh(returnStdout: true, script: "git rev-parse --short HEAD").trim()
28-
branch = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
28+
branch = scmVars.GIT_BRANCH.replaceAll("origin/", "")
2929

3030
}
3131

0 commit comments

Comments
 (0)