GitHub API Merge Pull Request

Hi,
I’m trying to automate via Jenkins the creation and the merge of a pull requests using the API.
I’m able to create the pull request

curl -H 'Authorization: token xxxxxx' -XPOST -d '{"title":"sbensaid_merge_pull_request", "base":"main", "head":"sbensaid_merge_pull_request", "body":"test"}' https://api.github.com/repos/otcshare/coreboot/pulls ==> OK

However checking the status of the pull request (merged or not) (55 is the pull request previously created)

curl -H 'Authorization: token xxxxx' https://api.github.com/repos/otcshare/coreboot/pulls/55/merge
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/pulls#check-if-a-pull-request-has-been-merged"
}

curl -H 'Authorization: token xxxxxx' -XPOST -d {"commit_title":"test API merge Pull Request"} https://api.github.com/repos/otcshare/coreboot/pulls/55/merge
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest"
}

Am I missing any thing?
Thanks for your help.
Selma.

1 Like