Introduction
This command-line application is mainly for continuous build and integration environments. It allows providing all of the details necessary to mark the status of a commit. For pull requests, it may read “All is Well” or “Merge with Caution” with an optional hyperlink to the CI build server, and optional description of the 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.1
New API argument, –context=”ci/teamcity” to distinguish multiple sources. Contributed by @kad in PR 3
- 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
Metadata
Release files for ghstat 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ghstat-0.3.1.tar.gz | 4.8 kB | Without provenance | Details for ghstat-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ghstat-0.3.1-cp27-none-macosx_10_10_x86_64.whl | CPython 2.7 | none | macOS 10.10+ x86-64 | Details for ghstat-0.3.1-cp27-none-macosx_10_10_x86_64.whl |
Total release size: 12.2 kB
Release files / ghstat-0.3.1.tar.gz
| Download URL | ghstat-0.3.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
126c4cd826275d97676da365b91411cb3e7eb166777e86e6bcf97835bc8017ca
|
|
BLAKE2b-256 checksum How to use checksums |
bba9af5cc3b61007c7477ef8f8a17adf608e54ce93710da8b3ac03af2761ac36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / ghstat-0.3.1-cp27-none-macosx_10_10_x86_64.whl
| Download URL | ghstat-0.3.1-cp27-none-macosx_10_10_x86_64.whl |
|---|---|
| Size | 7.4 kB |
| Tags | CPython 2.7 macOS 10.10+ x86-64 |
|
SHA-256 checksum How to use checksums |
178354ce948661f51367f1de72548c852d4ad18d6c6e9885acf304245ba7d0ff
|
|
BLAKE2b-256 checksum How to use checksums |
def79816e3a3a07fcfdaaed756ee48380417237cf03bbcd4a5564d306d9bbf54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ghstat 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.