• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Dev Tips / GitHub Bypass Failed Status Check

GitHub Bypass Failed Status Check

Last updated on August 6, 2024 by Sal Ferrarello

Sometimes a GitHub status check fails and you want to override it so you can still merge your PR. This is easiest to do with the GitHub CLI.

Your first step is to checkout your PR branch.

Get Information About the Status of Your Current Branch

gh api "repos/{owner}/{repo}/commits/{branch}/status" --jq '{ state: .state, sha: .sha, statuses: .statuses }'

Set a “success” status for the Current Branch

gh api --method POST \
  "repos/{owner}/{repo}/statuses/$(git rev-parse HEAD)" \
  -f state='success' \
  -f description='Manually added success!'

(note: context is default by default, we can set it to something else with -f context='example-of-different-context-value')

Without Using gh CLI

curl --verbose -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: Bearer $GH_TOKEN" \
  -d '{"state":"success","description":"Manually added success"}' \
  https://api.github.com/repos/salcode/my-repo/statuses/$(git rev-parse HEAD)

Notes:

  • You’ll need to replace salcode/my-repo with the relevant GitHub account and repo values.
  • You’ll need to set the environment variable GH_TOKEN to be set to your GitHub personal access token.

Relevant Reading:

  • GitHub Documentation on REST API for commit statuses
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP and JavaScript developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a principal engineer.

Filed Under: Dev Tips, Solution Tagged With: command line, GitHub

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2026 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in