From e9eb2c1163b16a49923304292ce6998be2d22c44 Mon Sep 17 00:00:00 2001 From: Daniel Mann Date: Wed, 2 Jul 2025 07:41:05 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index eba846e..5e0d151 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,24 @@ pipeline { } stages { + stage('Validate Run Parameters') { + steps { + script { + def jobParts = env.JOB_NAME.tokenize('/') + def detectedRepo = jobParts[1] + + echo "Detected Repo: ${detectedRepo}" + echo "Provided REPO_NAME: ${params.REPO_NAME}" + + if (params.REPO_NAME != detectedRepo) { + echo "Skipping build. REPO_NAME '${params.REPO_NAME}' does not match repo '${detectedRepo}'" + currentBuild.result = 'NOT_BUILT' + error("Stopping pipeline as REPO_NAME does not match repository.") + } + } + } + } + stage('Install Dependencies') { steps { script {