diff --git a/Jenkinsfile b/Jenkinsfile index f70a68e..481ba23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,13 @@ def deploy() { node('ubuntu') { try { checkout scm + + // Only deploy from main branch + def branch = env.BRANCH_NAME ?: sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim() + if (branch != 'main') { + echo "Skipping deployment: not on main branch (current branch: ${branch})" + return + } nodejs(nodeJSInstallationName: 'Node23') { stage('Install') {