diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index ae4e75a976..9df94edfbd 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -79,11 +79,13 @@ pipeline { expression { return isRelease() || isCreatePr() } } steps { - dir(getRepoName()) { - if (githubscm.isBranchExist('origin',getPRBranch())) { - githubscm.removeRemoteBranch('origin', getPRBranch()) + script { + dir(getRepoName()) { + if (githubscm.isBranchExist('origin',getPRBranch())) { + githubscm.removeRemoteBranch('origin', getPRBranch()) + } + githubscm.createBranch(getPRBranch()) } - githubscm.createBranch(getPRBranch()) } } }