Skip to content

Instantly share code, notes, and snippets.

@sandfox
Last active October 4, 2017 10:07
Show Gist options
  • Select an option

  • Save sandfox/e15f6b0b51fda6d86e78a3d2e351e7af to your computer and use it in GitHub Desktop.

Select an option

Save sandfox/e15f6b0b51fda6d86e78a3d2e351e7af to your computer and use it in GitHub Desktop.
how to update a github status from the cli

The above command allows you to update the "status" for a given commit (sha). Generally a PR will have 2 status contexts you need to set and each of them will have a different target-url which you can find via travis website and some exploring.

  • continuous-integration/travis-ci/push
  • continuous-integration/travis-ci/pr

The following are the only external dependencies:

  • You need node 6+ installed and npx (npm i -g npx)
  • You also need a github auth token, I strongly recommend generating a one-off token here with the only the permission repo:status and deleting once you are finished.
GITHUB_TOKEN={SOME_TOKEN} npx github-status-reporter \
--user ConnectedHomes \
--repo hivehome-webapp-v3 \
--description='The Travis CI build passed' \
--sha 671c590b695a67d9382c76287e375cc4a18a190a \
--state success \
--context continuous-integration/travis-ci/push \
--target-url='https://travis-ci.com/ConnectedHomes/hivehome-webapp-v3/builds/55985444'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment