diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index 8d5088f9f27..65ac55af5a4 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -45,8 +45,8 @@ pipeline { steps { script { dir(getRepoName()) { + approveAndMergePR(getDeployPrLink()) checkoutRepo() - mergeAndPush(getDeployPrLink()) tagLatest() } } @@ -59,10 +59,10 @@ pipeline { dir(getRepoName()) { checkoutRepo() if(githubscm.isReleaseExist(getGitTag(), getGitAuthorCredsId())) { - githubscm.deleteRelease(getGitTag(), getGitAuthorCredsId()) + githubscm.deleteRelease(getGitTag(), getGitAuthorPushCredsId()) } - githubscm.createReleaseWithGeneratedReleaseNotes(getGitTag(), getBuildBranch(), githubscm.getPreviousTagFromVersion(getGitTag()), getGitAuthorCredsId()) - githubscm.updateReleaseBody(getGitTag(), getGitAuthorCredsId()) + githubscm.createReleaseWithGeneratedReleaseNotes(getGitTag(), getBuildBranch(), githubscm.getPreviousTagFromVersion(getGitTag()), getGitAuthorPushCredsId()) + githubscm.updateReleaseBody(getGitTag(), getGitAuthorPushCredsId()) } } } @@ -182,10 +182,10 @@ void checkoutRepo() { sh "git checkout ${getBuildBranch()}" } -void mergeAndPush(String prLink) { - if (prLink) { - githubscm.mergePR(prLink, getGitAuthorCredsId()) - githubscm.pushObject('origin', getBuildBranch(), getGitAuthorPushCredsId()) +void approveAndMergePR(String prLink) { + if (prLink?.trim()) { + githubscm.approvePR(prLink, getGitAuthorPushCredsId()) + githubscm.mergePR(prLink, getGitAuthorPushCredsId()) } }