ci(backport): fix issue creation on cherry-pick conflict (#9048)

ci(backport): properly create issue on cherry-pick conflict

Signed-off-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
Ning Sun
2026-09-08 06:45:23 +00:00
committed by GitHub
parent ad5ccc98ec
commit 42a58080ea
+7 -4
View File
@@ -68,13 +68,16 @@ jobs:
git checkout -b "${head_branch}" "origin/${release_branch}"
if ! git cherry-pick -x "${MERGE_COMMIT}"; then
echo "ERROR: Cherry-pick failed for ${release_branch}. Creating an issue instead."
echo "ERROR: Cherry-pick failed for ${release_branch}. Aborting and creating an issue instead."
# Abort and clean up first so the repo is back to a sane state,
# even if the issue creation below fails.
git cherry-pick --abort
git checkout -f "${BASE_BRANCH}"
git branch -D "${head_branch}"
gh issue create \
--title "Backport failure: PR #${PR_NUMBER} to ${release_branch}" \
--body "Cherry-pick of ${MERGE_COMMIT} (PR #${PR_NUMBER}) failed on ${release_branch}. Manual backport required." \
git cherry-pick --abort
git checkout "${BASE_BRANCH}"
git branch -D "${head_branch}"
|| true
continue
fi