fix: merge when checks succeed
All checks were successful
Check / check (push) Successful in 51s

This commit is contained in:
trev 2025-05-14 10:02:08 -04:00
parent 56523795d5
commit 174d15de5b

View File

@ -44,7 +44,17 @@ jobs:
git push origin create-pull-request/patch --force git push origin create-pull-request/patch --force
curl -s -X POST -H "Authorization: token $PAT" \ CURRENT_PR=$(curl -s -X GET -H "Authorization: token $PAT" "https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls/main/create-pull-request/patch")
-H "Content-Type: application/json" \
-d '{"title":"update","body":"automatic update pr","head":"create-pull-request/patch","base":"main"}' \ if [ "$( jq 'has("errors")' <<< $CURRENT_PR )" == "true" ]; then
"https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls" PR_RESPONSE=$(curl -s -X POST -H "Authorization: token $PAT" \
-H "Content-Type: application/json" \
-d '{"title":"update","body":"automatic update pr","head":"create-pull-request/patch","base":"main"}' \
"https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls")
PR_NUMBER=$(echo "$PR_RESPONSE" | jq -r '.number')
curl -s -X POST -H "Authorization: token $PAT" \
-H "Content-Type: application/json" \
-d '{"Do":"merge","merge_when_checks_succeed":true}' \
"https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls/$PR_NUMBER/merge"
fi