diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index 73c70bff..911085f6 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -35,8 +35,11 @@ class SemanticReleasingExecutor { steps.sh "git branch --show-current" steps.sh "semantic-release" steps.log.info("SemanticReleasingExecutor", "Semantic release completed, read latest version from VERSION file") - steps.env.LATEST_VERSION = steps.readFile('VERSION').trim() - steps.env.SEMANTIC_RELEASED = true + def released = steps.sh(script: 'test -f "VERSION"', returnStatus: true) == 0 + if (released) { + steps.env.LATEST_VERSION = steps.readFile('VERSION').trim() + steps.env.SEMANTIC_RELEASED = true + } } } }