From 4227ca6965d02af753e5135b0b04436c2296071c Mon Sep 17 00:00:00 2001 From: Matias Pou Date: Tue, 6 Jan 2026 16:13:25 -0300 Subject: [PATCH] test --- Jenkinsfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e9d2293..e6d6c53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,11 +22,16 @@ pipeline { sh 'git submodule update --init --recursive' - if (env.BRANCH_NAME !== 'main') { - echo "[!] Not on main branch. Stopping pipeline." + def branch = sh( + script: "git rev-parse --abbrev-ref HEAD", + returnStdout: true + ).trim() + + if(branch != 'main') { + echo "[!] Not on 'main' branch. Current branch: ${branch}" currentBuild.result = 'SUCCESS' error("Stopping pipeline: not on main branch.") - } + } def tagName = sh( script: "git describe --tags --exact-match 2>/dev/null || echo 'no-tag'",