This commit is contained in:
parent
56523795d5
commit
174d15de5b
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user