As per API documentation https://docs.github.com/en/rest/reference/pulls#create-a-review-for-a-pull-request
We can use a CURL to approve pull request i.e.
curl -s -H "Authorization: token ghp_TOKEN" \
-X POST -d '{"event": "APPROVE"}' \
"https://api.github.com/repos/{owner}/{repo}/pulls/{pull_number}/reviews"
but I get this error:
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest"
}
Although, the CURL is working fine for other APIs like:
curl -s -H "Authorization: token ghp_TOKEN" \
-X POST -d '{"body": "some message"}' \
"https://api.github.com/repos/{owner}/{repo}/issues/{pull_number}/reviews"
I have tried everything to make this work. Can somebody please help me with this?
curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/octocat/hello-world/pulls/42/reviews \ -d '{"commit_id":"commit_id"}'