From 32352f7edfd8b236f2a7d257966f6890d7ae4ecf Mon Sep 17 00:00:00 2001 From: Kangyan-Zhou Date: Thu, 21 May 2026 20:10:12 +0800 Subject: [PATCH] [CI] Fix bot-cherry-pick: use state == "MERGED" instead of invalid `merged` field (#25987) --- .github/workflows/bot-cherry-pick.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bot-cherry-pick.yml b/.github/workflows/bot-cherry-pick.yml index ae040a4da..1611e41e1 100644 --- a/.github/workflows/bot-cherry-pick.yml +++ b/.github/workflows/bot-cherry-pick.yml @@ -89,13 +89,12 @@ jobs: PR_URL="" if [[ -n "$PR_NUMBER" ]]; then - if ! PR_JSON=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json state,merged,mergeCommit,title,number,url); then + if ! PR_JSON=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json state,mergeCommit,title,number,url); then echo "::error::Failed to fetch PR #$PR_NUMBER from $GITHUB_REPOSITORY (see gh output above)." exit 1 fi - MERGED=$(jq -r '.merged' <<<"$PR_JSON") STATE=$(jq -r '.state' <<<"$PR_JSON") - if [[ "$MERGED" != "true" ]]; then + if [[ "$STATE" != "MERGED" ]]; then echo "::error::PR #$PR_NUMBER is not merged (state=$STATE). Only merged PRs can be cherry-picked." exit 1 fi