From b85cd67d55cd212733bfafc11da50d5f4bd03a01 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Mon, 21 Apr 2025 11:34:04 +0800 Subject: [PATCH] fix: correct variable usage in recentlyModified check for VERSION file Signed-off-by: zhenyus --- .../com/freeleaps/devops/SemanticReleasingExecutor.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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