From 5510fcfc2165a85d47fdabfde6bcf1c951233b2c Mon Sep 17 00:00:00 2001 From: Divya Madala Date: Wed, 6 Mar 2024 17:05:49 -0800 Subject: [PATCH] checkout to before commit for working code Signed-off-by: Divya Madala --- jenkins/release/release-branch.jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jenkins/release/release-branch.jenkinsfile b/jenkins/release/release-branch.jenkinsfile index 40bd3a18fa..87b3ff73ca 100644 --- a/jenkins/release/release-branch.jenkinsfile +++ b/jenkins/release/release-branch.jenkinsfile @@ -75,12 +75,11 @@ pipeline { echo "Branch already exists" continue } - } - dir("opensearch-build") { - checkout([$class: 'GitSCM', branches: [[name: "oncall"]], userRemoteConfigs: [[url: "https://github.com/Divyaasm/opensearch-build.git"]]]) + dir(component) { + checkout([$class: 'GitSCM', branches: [[name: SOURCE_BRANCH]], userRemoteConfigs: [[url: repoUrl]]]) sh "git checkout -b $TARGET_BRANCH" - sh "git push origin $TARGET_BRANCH" + } } } }