[CI] Fix bot-cherry-pick: use state == "MERGED" instead of invalid merged field (#25987)
This commit is contained in:
@@ -89,13 +89,12 @@ jobs:
|
|||||||
PR_URL=""
|
PR_URL=""
|
||||||
|
|
||||||
if [[ -n "$PR_NUMBER" ]]; then
|
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)."
|
echo "::error::Failed to fetch PR #$PR_NUMBER from $GITHUB_REPOSITORY (see gh output above)."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
MERGED=$(jq -r '.merged' <<<"$PR_JSON")
|
|
||||||
STATE=$(jq -r '.state' <<<"$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."
|
echo "::error::PR #$PR_NUMBER is not merged (state=$STATE). Only merged PRs can be cherry-picked."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user