fix(pr merge): on 405, fetch and print PR merge status

This commit is contained in:
lyn
2026-04-01 17:03:34 +00:00
parent e014af3516
commit 6d9144830b

View File

@@ -252,6 +252,11 @@ cmd_merge() {
;; ;;
405) 405)
echo "merge failed check the pr status" echo "merge failed check the pr status"
# Fetch PR details to show merge status
PR_INFO=$(curl -s -X GET "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/${pr_index}" \
-H 'accept: application/json' \
-H "Authorization: token ${token}")
echo "$PR_INFO" | jq '{mergeable: .mergeable, head_sha: .head.sha, base_ref: .base.ref, head_ref: .head.ref}'
exit 1 exit 1
;; ;;
*) *)