5

How do you delete a GitHub pull request requested review? This is about deleting the request for review on a pull request, not the pull request itself. I can't find a way using the website.

I also tried using the REST API:

curl -i -X DELETE -u cherryblossom000 https://api.github.com/repos/<repo owner>/<repo name>/pulls/<pull number>/requested_reviewers -d '{"reviewers":["reviewer name"]}'

but I get this error:

{
  "message": "Validation Failed",
  "errors": [
    "Could not add requested reviewers to pull request."
  ],
  "documentation_url": "https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request"
}

The GraphQL API doesn't seem to have a mutation to delete a review request either.

Lauren Yim
  • 12,700
  • 2
  • 32
  • 59
  • I think you [can't delete a pull request](https://stackoverflow.com/questions/18318097/delete-a-closed-pull-request-from-github), you can only [close it](https://stackoverflow.com/questions/5385567/how-to-cancel-a-pull-request-on-github). – Gino Mempin Oct 30 '19 at 06:04
  • @GinoMempin I'm talking about deleting the request someone to review the pull request, not deleting the actual pull request. – Lauren Yim Oct 30 '19 at 06:05

1 Answers1

2

I too had this problem and also got several "Validation failed" messages. So I figured it might be because I didn't have direct permissions on the repo.

After emailing Github developer support, they confirmed that you can delete (or dismiss) a review request, provided you have direct permissions on the repository.

In conclusion, your REST API approach is correct. You only get the "Validation failed" message if you do not have direct permissions on the repo.

Zero-1729
  • 78
  • 1
  • 2
  • 7
  • 1
    Could you clarify what does direct permission mean here? Is write permission on repo enough? – Roseau Aug 23 '21 at 11:41