Skip to main content

Command-line application to get or set github commit status.

Project description

Latest Version License Downloads

Introduction

This command-line application is mainly for continuous build and integration environments. It allows one to set provide all of the details necessary to mark a commit, for pull requests, to read “All is Well” or “Merge with Caution” with an optional hyperlink to the CI build server, or description of build failure.

This is done using the Github v3 API.

This is not a very serious package, there are not any plans to advance it further. It was authored because existing github python client packages such as pygithub3 did not offer the ability to communicate with the ‘statuses’ api endpoints, and it is preferred to provide well-readable command-line arguments in the build script than to use curl directly.

Installation

The stable version of this package is maintained on pypi, install using pip:

pip install ghstat

Generate a personal access token, https://github.com/settings/applications, enabling scope repo:status and public_repo or private_repo, respectively.

Use this token for the –token parameter, or as the environment variable GITHUB_APP_TOKEN

Examples

Failing a build on github.com:

ghstat.py set --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 72b74be0de46392a05d8f470b64272b8036e63f8 \
              --user jquast --repo ghstat --state success

Retrieving the status of a commit as json data to stdout:

ghstat.py get --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 72b74be0de46392a05d8f470b64272b8036e63f8 \
              --user jquast --repo ghstat

Linking to a private bamboo and github enterprise account:

ghstat.py set --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a \
              --user jquast \
              --repo ghstat \
              --state success \
              --description 'build successful' \
              --target-url 'https://bamboo.mycorp.com/browse/PROJ-BUILD10-1' \
              --base-url 'https://github.mycorp.com/api/v3/'

Others

githubdate: Same thing, only it uses an .ini file instead of cmd-line parameters.

Changes

0.3.0
  • For descriptions of length greater than 140, truncate and emit a warning to standard error. It will be changed to a length of 140 ending in text marker `` (…)``.

0.2.0
  • Support python 3

  • Support token as environment value GITHUB_APP_TOKEN

  • Resolve IndexError when retrieving status for a commit without any.

0.1.0
  • Initial release to pypi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghstat-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

ghstat-0.2.0-cp34-cp34m-macosx_10_9_x86_64.whl (6.3 kB view details)

Uploaded CPython 3.4m macOS 10.9+ x86-64

File details

Details for the file ghstat-0.2.0.tar.gz.

File metadata

  • Download URL: ghstat-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ghstat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 10a1771f886631ffd30f065f4f5fa1aa671b46e582db0650b6b983417926dfa1
MD5 8a03430454adb5b7162ad349e3eb5227
BLAKE2b-256 b640f669ee8bfbc1141dbca81827a9d3112e16a389aea66bba2cb66a2681703f

See more details on using hashes here.

File details

Details for the file ghstat-0.2.0-cp34-cp34m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ghstat-0.2.0-cp34-cp34m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6588ecb0d29152603f366e4e18bbd9464b5aa368357b3968bc8a7c4af5cce904
MD5 cb69074e443093798ef3342a2aeae5cf
BLAKE2b-256 5544d47b5311b3dc63cfde8f5fc4d798af558843ba62fa7cb680a34861795e0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page