Skip to content

Commit 268bf8e

Browse files
new repo
1 parent 51847f0 commit 268bf8e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/actions_release.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ jobs:
6262
BASE_BRANCH="${{ inputs.base_branch }}"
6363
PR_TITLE="chore: Cherry-picked changes from upstream"
6464
65-
echo "🔍 Looking for existing PR from '$BRANCH_NAME' to '$BASE_BRANCH' or with title '$PR_TITLE'"
65+
echo "🔍 Checking for open PR with title: $PR_TITLE"
66+
TITLE_MATCH=$(gh pr list --repo "$REPO" --state open --json number,title \
67+
--jq ".[] | select(.title == \"$PR_TITLE\") | .number" | tr -d '\n')
6668
67-
PR_MATCH=$(gh pr list --repo "$REPO" --state open --json number,title,headRefName,baseRefName \
68-
--jq ".[] | select((.title == \"$PR_TITLE\") or (.headRefName == \"$BRANCH_NAME\" and .baseRefName == \"$BASE_BRANCH\")) | .number")
69+
echo "🔍 Checking for open PR from branch $BRANCH_NAME to $BASE_BRANCH"
70+
BRANCH_MATCH=$(gh pr list --repo "$REPO" --state open --json number,headRefName,baseRefName \
71+
--jq ".[] | select(.headRefName == \"$BRANCH_NAME\" and .baseRefName == \"$BASE_BRANCH\") | .number" | tr -d '\n')
6972
70-
if [ -n "$PR_MATCH" ]; then
71-
echo "❌ A cherry-pick PR already exists (PR #$PR_MATCH)."
73+
if [[ -n "$TITLE_MATCH" || -n "$BRANCH_MATCH" ]]; then
74+
echo "❌ A cherry-pick PR already exists (PR #${TITLE_MATCH:-$BRANCH_MATCH})."
7275
echo "🔁 Please review and merge the existing PR before retrying."
7376
exit 0
7477
else

0 commit comments

Comments
 (0)