From f5aa9d413f0f6af744c611bc0acaa16d0b7c1ef3 Mon Sep 17 00:00:00 2001 From: Constantin Nicolai Date: Mon, 9 Oct 2023 18:50:34 +0200 Subject: [PATCH] placed build number check before time comp --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b9eccbcb..2a1780dc3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -120,8 +120,11 @@ pipeline { stage('Check Dependencies') { when { - expression { - return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000000) && (currentBuild.number > 1) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000000 one month in milliseconds + expression { + if (currentBuild.number > 1) { + return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000000) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000000 one month in milliseconds + } + return false } } steps {