How do I remove a GitHub status check?

11,531

Solution 1

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.

Solution 2

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! >
Share:
11,531

Related videos on Youtube

jameslafferty
Author by

jameslafferty

I'm a senior front end web engineer at Workday. Avocados, Shakespeare and Farscape are examples of some things I think are cool. In the past, I've taught PHP, JavaScript and Angular. These days I code a lot of Typescript/React and occasionally mess up some Java.

Updated on June 04, 2022

Comments

  • jameslafferty
    jameslafferty almost 2 years

    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?

    • gabel
      gabel about 5 years
      You can overwrite a status by name. See webapps.stackexchange.com/a/78518 for a working solution
    • Diego Pamio
      Diego Pamio about 5 years
      Having the same issue.
    • jameslafferty
      jameslafferty over 4 years
      @gabel overwriting does not a delete make though, does it? It'd be cleaner if an actual delete were possible, no?
    • gabel
      gabel over 4 years
      @jameslafferty No it doesn't but as you can overwrite the context you could do something like.. PROCESS-A: pending --- overwrite it with CANCELED: successful
  • jameslafferty
    jameslafferty over 6 years
    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
    jameslafferty over 6 years
    Boo! It looks like this is the actual answer, which is lame. But points to @VonC!
  • VonC
    VonC over 5 years
    Interesting alternative. +1
  • jameslafferty
    jameslafferty over 5 years
    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.
  • Ian Paschal
    Ian Paschal about 5 years
    This does not actually remove the status check from running, only from preventing a failed status check from blocking a merge.
  • zzz
    zzz over 4 years
    Unfortunately, this solution now returns a "Rule is invalid" error when trying to enable it.
  • phillipuniverse
    phillipuniverse over 4 years
    > Unfortunately, this solution now returns a "Rule is invalid" error when trying to enable it. You must specify a branch pattern so just put *