fix(pr merge): on 405, fetch and print PR merge status
This commit is contained in:
@@ -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
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user