Skip to main content

A simple command line for updating a GitHub status

Project description


A simple command line for updating a GitHub status

Project and Build Status

.. image::
:alt: Travis tests

.. image::
:alt: Updates

.. image::
:alt: Python 3

.. image::
:alt: Documentation Status

.. image::
:alt: Windows build status on Appveyor

* GitHub repo:
* Documentation: `Read The Docs <>`_
* Free software: `LICENSE <>`_

How to Configure


If you have every looked at a Pull Request in GitHub, you've seen that there are
"Checks" that should pass before the Pull Request is merged. If all is well, you
will see a message like "All checks have passed" and a big green button "Merge
pull request." Or, on a very bad day, you may see a large red 'X' with a message
like 'All checks have failed.'

How exactly does that get set? To help teach about GitHub integrations, this
command was made so one can see how updates to Git Hub pull requests are made.

In reality, this is an update of a "status" of a commit hash. And, GitHub
reflects those statuses in a Pull Request.

Personal Access Token

This code is intended to change the status of a GitHub Pull Request. That is
something that should only be allowed by someone who is authorized. You wouldn't
want someone that you hadn't authorized updating your Pull Request statuses. So,
you will need to generate a Personal Access Token so that you can authorize
yourself to update.

This is done in your account settings configuration. Don't confuse the project
settings with the settings for your account

Profile Settings

In the upper right hand corner, you will see your avatar photo (or a default
avatar image). When you click the avatar, there will be a drop down menu with
meu options such as:

- Signed in as...
- Your profile
- Your stars
- Your gists
- Help
- **Settings**
- Sign out

Choose the **Settings** option.

Developer Settings

On the next page that is loaded, the Profile settings page, you will see another
menu to the left. It is a longer menu where the bottom looks similar to:

- Repositories
- Organizations
- Saved replies
- Applications

- **Developer settings**

Note that **Developer settings** is offset from the other menu. Choose
**Developer settings**.

Personal Access Tokens
Os the next page, the Developer Settings page, you will see one final menu:

- OAuth Apps
- GitHub Apps
- **Personal access tokens**

Choose **Personal access tokens**.

1. Press the button to **Generate new token**.
2. In the **Token description** enter "github_commit_status". This way we
remember the purpose of this token.
3. Select the **repo:status** scope checkbox. Anyone who has this token could
update your GitHub account. So, keep the scope of that the token can do to be
**only** updating or accessing the commit status.
4. Scroll to the bottom of click the green **Generate token** button.
5. Your should now be displayed. This token will only display this time. You
won't be able to see it again and it cannot be recovered.
6. Keep your token safe so that you can use it with this program. Remember, if
someone else can access this token, they can update your GitHub statuses -
even if you don't want them to.

Name of the repository

The Personal Access Token that you have generated above can be used to update
any repository that you have access to. You will need to specify the repository
to update.

Remember, the GitHub URL has the repository name. The format is as follows:<github_username>/<project_name>

For example, the Linux GitHub repository is at this URL:

The username is **torvalds** (Linus Torvalds) and the GitHub respoitory name is

You will need the name of your repository when using this program.

How to use

Find a commit in a Pull Request that you would like to update.

1. `pip install github_commit_status`

2. run `github_commit_status`

3. Enter the data that you have collected as seen in the code snippet below.
Don't worry, I deleted this GitHub token in this example before this was ever
published. (You should *always* keep your Personal Access Tokens to GitHub a
secret - its like a password):

.. code::

$ github_commit_status
Github token []: 26fee6a5d440111a2648312d458b6b4e44c20c1d
Name of the GitHub repository []: experiment_20180525
Commit SHA []: 2dd5f9ce1108d69e863444ee6486e64e0299868f
Status: pending
Description: Tests are running
GitHub has been updated.

Make this better by Contributing

This is an Open Source project and contributions are always welcome, and they
are greatly appreciated! Every little bit helps, and credit will always be

You can contribute in many ways:

* `Report bugs <>`__
* `Write Documentation <>`__
* `Fix bugs <>`__

To maximize the chance that your hard work gets merged, we have these guidelines
to guide you along the way to a successfully merged Pull Request:

* :ref:`contribution_link`

Project details

Download files

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

Files for github-commit-status, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size github_commit_status-1.0.1-py2.py3-none-any.whl (5.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size github_commit_status-1.0.1.tar.gz (17.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page