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