diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index 13543cb2..844f3e76 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -25,6 +25,11 @@ def call(Closure closure) { stages { stage("Commit Linting If Enabled") { + when { + expression { + return configurations.commitMessageLintEnabled != null && configurations.commitMessageLintEnabled + } + } agent { kubernetes { defaultContainer 'commit-message-linter' @@ -52,17 +57,11 @@ spec: } steps { script { - def enabled = configurations.commitMessageLintEnabled - - if (enabled == null || !enabled) { - log.warn("Pipeline","Commit message linting is disabled") - } else if (enabled) { - log.info("Pipeline","Commit message linting is enabled") - sourceFetcher.fetch(configurations) + log.info("Pipeline","Commit message linting is enabled") + sourceFetcher.fetch(configurations) - def linter = new CommitMessageLinter(this) - linter.lint(configurations) - } + def linter = new CommitMessageLinter(this) + linter.lint(configurations) } } } @@ -74,7 +73,7 @@ spec: if (executeMode == null || executeMode.isEmpty()) { log.warn("Pipeline","Not set executeMode, using fully as default execute mode") env.executeMode = "fully" - } else if (executeMode == 'on-demand' && serviceGitRepoType != 'monorepo') { + } else if (executeMode == 'on-demand' && configurations.serviceGitRepoType != 'monorepo') { log.warn("Pipeline","serviceGirRepoType is not monorepo, on-demand mode is not supported, using fully mode") env.executeMode = "fully" } else {