9

I've been looking for a means of removing some status checks created by a CI tool I was evaluating from my pull requests in my GitHub repository, but I haven't had any luck finding a way of achieving this.

Looking at the status checks API docs, there doesn't seem to be DELETE endpoint for the Statuses API and I could not find anything obvious in the UI.

1

The URL is now (with the v3 API):

https://api.github.com/repos/:owner/:repo/statuses/:sha

See https://developer.github.com/v3/repos/statuses/

  • 1
    How is this a correct answer? There is no DELETE operation on that URL, is there? – Vampire May 15 '18 at 11:29
5

The best solution I've been able to come up with is to create a new status on the same context as successful. This way I can remove the build URL from the status checks and the PRs don't show up as failing (as they were in my case).

To do this I iterated through all the most recent SHAs of my Pull Requests and made the following API call using curl:

curl --user "username" --data @- https://api.github.com/repos/:owner/:repo/commits/:sha
{
  "state": "success",
  "description": "The build succeeded!",
  "context": "default"
}

It doesn't completely erase the build history (so it can still be found using the API), but on the pull request pages everything looks like business as usual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.