Skip to content

Commit 853aaa0

Browse files
authored
Fix use on new projects
1 parent 48f984d commit 853aaa0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vars/mavenCiPipeline.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ def call(Closure closure) {
4848
def gitAuthorEmail = env.CHANGE_AUTHOR_EMAIL ? env.CHANGE_AUTHOR_EMAIL : sh(returnStdout: true, script: 'git log -1 --format="%aE" HEAD').trim()
4949
sh "git config user.name '${gitAuthor}'"
5050
sh "git config user.email '${gitAuthorEmail}'"
51-
def lastTag = sh(returnStdout: true, script: "git describe --abbrev=0 --tags").trim()
51+
def lastTag = "Unknown"
52+
try {
53+
lastTag = sh(returnStdout: true, script: "git describe --abbrev=0 --tags").trim()
54+
} catch (Exception e) {
55+
echo "Could not query the last tag."
56+
}
5257
echo "Last Tag: ${lastTag}"
5358

5459
// Set Build Information

0 commit comments

Comments
 (0)