Skip to content

Commit e431736

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 34bcc4e commit e431736

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/scripts/backport-commit.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ BRANCH_NAME="backport/${SHORT_SHA}-to-${TARGET_BRANCH}"
8989

9090
echo -e "${YELLOW}Generated branch name: ${BRANCH_NAME}${NC}"
9191

92-
SEARCH_QUERY="${COMMIT_URL} in:body"
93-
EXISTING_PR="$(gh pr list --state all --search "$SEARCH_QUERY" --json url --jq '.[0].url' 2>/dev/null || true)"
92+
EXISTING_PR="$(gh pr list --state all --head "$BRANCH_NAME" --json url --jq '.[0].url' 2>/dev/null || true)"
9493
if [[ -n "$EXISTING_PR" ]]; then
9594
echo -e "${GREEN}PR already exists: ${EXISTING_PR}. Skipping duplicate.${NC}"
9695
exit 0
@@ -144,6 +143,8 @@ echo -e "${YELLOW}Creating pull request...${NC}"
144143
if [[ "$HAS_CONFLICTS" == "true" ]]; then
145144
PR_TITLE="conflict: ${COMMIT_TITLE}${TITLE_SUFFIX}"
146145
PR_BODY=$(cat <<EOF
146+
<!-- backport:${COMMIT_SHA} -->
147+
147148
## ⚠️ Backport With Conflicts
148149
149150
- Upstream commit: ${COMMIT_URL}
@@ -164,6 +165,8 @@ EOF
164165
else
165166
PR_TITLE="${COMMIT_TITLE}${TITLE_SUFFIX}"
166167
PR_BODY=$(cat <<EOF
168+
<!-- backport:${COMMIT_SHA} -->
169+
167170
## 🔄 Automated Backport
168171
169172
- Upstream commit: ${COMMIT_URL}

0 commit comments

Comments
 (0)