31

I have a GitHub status check generated by TeamCity, and I'm trying to delete it (not just disable it).

I've tried (line breaks added for readability):

curl -u <myusername>:<mytoken>
 -X DELETE
https://:github_instance/api/v3/repos/:user/:repo/statuses/:hash

I got the url from:

curl -u <myusername>:<mytoken> 
https://:github_instance/api/v3/repos/:user/:repo/statuses/:branch_name

Am I missing something?

jameslafferty
  • 2,152
  • 2
  • 21
  • 25

2 Answers2

29

Like @VonC I couldn't find a deletion option. However, you can disable any existing checks so that they no longer run on your PRs.

Settings
  Branches
    Branch protection rules  
      Edit (next to your desired branch, e.g. 'master')  
        Rule settings  
          Require status checks to pass before merging
            Require branches to be up to date before merging 
              < Uncheck any statuses you want to disable! >
indigobuffalo
  • 391
  • 3
  • 3
  • Interesting alternative. +1 – VonC Oct 18 '18 at 20:21
  • I'll vote this up, as folks might find it useful. I still think @VonC's answer remains correct. It'd be nice if GitHub provided a real solution. – jameslafferty Oct 18 '18 at 20:33
  • 6
    This does not actually remove the status check from running, only from preventing a failed status check from blocking a merge. – Ian Paschal Mar 28 '19 at 11:03
  • Unfortunately, this solution now returns a "Rule is invalid" error when trying to enable it. – zzz Oct 07 '19 at 21:39
  • > Unfortunately, this solution now returns a "Rule is invalid" error when trying to enable it. You must specify a branch pattern so just put * – phillipuniverse Nov 14 '19 at 13:52
20

I see the GitHub API V3 Repository Statuses (for github.com or for a private GitHub enterprise instance) includes:

  • Create a status
  • List statuses for a specific ref
  • Get the combined status for a specific ref

There is no deletion as far as I can see.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yeah, I didn't see anything there either. Was hoping someone knew something beyond the documentation. Le sigh. I'll keep on holding my breath for a solution, but you get my upvote. – jameslafferty Jan 05 '18 at 15:00
  • Boo! It looks like this _is_ the actual answer, which is lame. But points to @VonC! – jameslafferty Jan 13 '18 at 01:21