File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030echo " OK PR is merged."
3131echo " Checking PR merge commit"
3232PR_MERGE_COMMIT=$( getJsonItem merge_commit_sha)
33- echo " OK PR merge status is ${PR_MERGE_COMMIT} "
33+ echo " OK PR merge commit is ${PR_MERGE_COMMIT} "
3434PR_TITLE=$( getJsonItem title)
3535PR_BODY=$( getJsonItem body)
3636PR_OWNER=$( getJsonItem user.login)
3737PR_REPO=$( getJsonItem head.repo.name)
3838git clone $PR_CLONE_URL & > /dev/null
3939pushd ${PR_REPO}
4040git checkout ${TARGET_BASE_BRANCH} & > /dev/null
41- git checkout -b backport_$( date +%s)
42- if ! git cherry-pick -x ${PR_MERGE_COMMIT} ; then
41+ BRANCH_NAME=backport_$( date +%s)
42+ git checkout -b ${BRANCH_NAME}
43+ if ! git cherry-pick -x ${PR_MERGE_COMMIT} ; then
4344 git cherry-pick --abort & > /dev/null || true
4445 echo " Cherry-pick failed! Performing patch method..."
4546 PR_PATCH_URL=$( getJsonItem patch_url)
@@ -60,4 +61,4 @@ git push origin HEAD
6061if [ ${REVIEWERS:- } = " _OWNER_" ]; then
6162 REVIEWERS=$PR_OWNER
6263fi
63- gh pr create --repo $PR_CLONE_URL --title " ${PR_TITLE} " --body " ${PR_BODY} " --reviewers " ${ REVIEWERS}" --assignee " ${PR_OWNER} " --base " ${TARGET_BASE_BRANCH} " --branch HEAD
64+ gh pr create --repo $PR_CLONE_URL -f --reviewer " ${REVIEWERS} " --assignee " ${PR_OWNER} " --base " ${TARGET_BASE_BRANCH} " --head ${BRANCH_NAME}
You can’t perform that action at this time.
0 commit comments