Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenali committed Mar 2, 2023
1 parent 9619c9d commit 8966988
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions github/backportPR.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ fi
echo "OK PR is merged."
echo "Checking PR merge commit"
PR_MERGE_COMMIT=$(getJsonItem merge_commit_sha)
echo "OK PR merge status is ${PR_MERGE_COMMIT}"
echo "OK PR merge commit is ${PR_MERGE_COMMIT}"
PR_TITLE=$(getJsonItem title)
PR_BODY=$(getJsonItem body)
PR_OWNER=$(getJsonItem user.login)
PR_REPO=$(getJsonItem head.repo.name)
git clone $PR_CLONE_URL &>/dev/null
pushd ${PR_REPO}
git checkout ${TARGET_BASE_BRANCH} &>/dev/null
git checkout -b backport_$(date +%s)
if !git cherry-pick -x ${PR_MERGE_COMMIT}; then
BRANCH_NAME=backport_$(date +%s)
git checkout -b ${BRANCH_NAME}
if ! git cherry-pick -x ${PR_MERGE_COMMIT}; then
git cherry-pick --abort &>/dev/null || true
echo "Cherry-pick failed! Performing patch method..."
PR_PATCH_URL=$(getJsonItem patch_url)
Expand All @@ -60,4 +61,4 @@ git push origin HEAD
if [ ${REVIEWERS:-} = "_OWNER_" ]; then
REVIEWERS=$PR_OWNER
fi
gh pr create --repo $PR_CLONE_URL --title "${PR_TITLE}" --body "${PR_BODY}" --reviewers "${REVIEWERS}" --assignee "${PR_OWNER}" --base "${TARGET_BASE_BRANCH}" --branch HEAD
gh pr create --repo $PR_CLONE_URL -f --reviewer "${REVIEWERS}" --assignee "${PR_OWNER}" --base "${TARGET_BASE_BRANCH}" --head ${BRANCH_NAME}

0 comments on commit 8966988

Please sign in to comment.