GitHub pull request icon status check in case of failed non required checks

63 views Asked by At

In GitHub repo we have checks for pull requests (PR). Some of them are required (must be passed to make PR merge possible), others - not.

enter image description here

From my point of view it would be good to mark PR with green tick when all required checks are passed, independently of number of failed non-required checks. But currently even if a single non-required check is failed (doesn't prevent to merge PR) the whole PR status is marked by red cross.

Is it possible to set something in repository settings to say ignore non-required checks' statuses and take into account only required check as an input for resulting icon (cross or tick)?

1

There are 1 answers

0
VonC On BEST ANSWER

As far as I know, GitHub does not provide a built-in feature to mark pull requests with a green tick when all required checks have passed if there are non-required checks that have failed. The status checks reflect the state of both required and non-required checks, and a failure in any of them would result in the PR being marked with a red cross.

However, you can communicate the distinction between required and non-required checks to the team members by:

  • documenting your workflow and making sure that contributors and reviewers are aware of which checks are required.
  • using naming conventions to differentiate required checks from optional ones.
  • customizing your merge requirements so that only required checks block merging.

The merge button will still be active if only non-required checks fail, indicating to maintainers that the PR can be merged.

A third-party tool like, for instance, dlvhdr/gh-dash could be updated to report a combined status based on your specific rules. Or you could write a custom GitHub Action that checks the status of required checks and sets a commit status based on those.