diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index 239fda17..5f88be8f 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -40,12 +40,12 @@ class SemanticReleasingExecutor { def recentlyModified = false if (versionFileExists) { // check if VERSION file was modified recently (within last minute) - def recentlyModified = steps.sh(script: 'stat -c %Y "VERSION"', returnStdout: true).trim() as Long + def modTime = steps.sh(script: 'stat -c %Y "VERSION"', returnStdout: true).trim() as Long def currentTime = System.currentTimeMillis() / 1000 - recentlyModified = (currentTime - recentlyModified) < 60 + recentlyModified = (currentTime - modTime) < 60 } - def released = fileExists && recentlyModified + def released = versionFileExists && recentlyModified if (released) { steps.env.LATEST_VERSION = steps.readFile('VERSION').trim() steps.env.SEMANTIC_RELEASED = true