We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48f984d commit 853aaa0Copy full SHA for 853aaa0
vars/mavenCiPipeline.groovy
@@ -48,7 +48,12 @@ def call(Closure closure) {
48
def gitAuthorEmail = env.CHANGE_AUTHOR_EMAIL ? env.CHANGE_AUTHOR_EMAIL : sh(returnStdout: true, script: 'git log -1 --format="%aE" HEAD').trim()
49
sh "git config user.name '${gitAuthor}'"
50
sh "git config user.email '${gitAuthorEmail}'"
51
- def lastTag = sh(returnStdout: true, script: "git describe --abbrev=0 --tags").trim()
+ 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
+ }
57
echo "Last Tag: ${lastTag}"
58
59
// Set Build Information
0 commit comments