test
This commit is contained in:
parent
970fd0cb11
commit
4227ca6965
1 changed files with 8 additions and 3 deletions
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
|
|
@ -22,8 +22,13 @@ 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.")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue