How can I create a simple status check?

To me, the documentation on how to create status checks is confusing.

  • What is necessary at a minimum to create a simple status check?
  • Can I use GitHub Actions for it if I just want to execute a build or test run?
  • How are GitHub Actions and Status Checks correlated?
  • Are they correlated at all?
  • If not, what’s the difference between an Action that’s executed on a commit and a Status Check that’s executed on a pull request?

Status checks means that a commit is validated via some service — GitHub Actions are one examples, but there are many other third party Continuous Integration (CI) services that can be used, e.g. Travis CI or Circle CI, just to mention a couple.

A status check is related to some task being run by some service, which either returns an exit code 0 (no error) or non-zero (an error). In other words, the status check reports the final exit code of the execution of some validation code on a commit — be it a single script, or multiple scripts.

The idea is to provide an easy visual cue to whether a commit has met some standards; further details of the check failure can be obtained by clicking on the status icon, which ultimately will lead to a link to the service which reported the status, which usually offers a detailed log of what failed, where and why.

A pull request is a branch which you’re asking to be merged into the target repository. It may contain a single commit or multiple ones. Depending on what your assigned status check tasks do, you usually get a report for the status of the whole branch, with each commit.

When looking at the PR page on GitHub, you’ll see the status check for each commit, so you can track how each one relates to your checks. Maybe a commit fails the check, but the next one fixes the unmet standards and passes, which means that the head of the PR branch meets the requirements.

1 Like