Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 2.13 KB

how-to-one-required-check.md

File metadata and controls

39 lines (28 loc) · 2.13 KB

How-to for a single required check

The Github guidance for handling skipped but required checks is really not helpful. And previously was different, advocating for pairs of jobs when there was path restrictions.

A different mechanism is to have only one required check. It's purpose is to confirm that the other checks on the PR were successful.

  1. Have a workflow that looks at all the checks on the current PR, and sets it's status based on the outcomes of the other checks.

  2. Confirm there is only one required check:

    Settings -> Branches

    Protect Matching Branches

  3. Other checks in the repo can use the usual filtering mechanisms to execute selectively against the PRs where they have value.

Examples

This repository has 7 workflows. One that is required:

And 6 more that execute selectively based on the paths in the PR:

Example PRs:

  • A PR with both Rust and Python changes. The Python check is failing, so the 'Check checks' is failing, so the merge is blocked.
  • A PR with a successful SQL change.
  • A PR with Bash, SQL, and Go changes, all failing.