Home > Software design >  Github optional status check
Github optional status check

Time:07-05

Does github support optional status check in the pull request? I'm using mono repo in my github. Thus there are many circle-ci checks with different workflow deployments. Every time when I create a new pull request I need to approve and pass all of the checks which most of them are not related to my change.

Is there any way that I can skip these checks or can be controlled by pull request author to customized the status check workflow? Or maybe at least, can I mark some of the github checks as optional?

CodePudding user response:

There is one possible solution or workaround (Feb. 2021):

GitHub Actions: Skip pull request and push workflows with [skip ci]

GitHub Actions now supports skipping push and pull_request workflows by looking for some common keywords in your commit message.

If any commit message in your push or the HEAD commit of your PR contains the strings [skip ci], [ci skip], [no ci], [skip actions], or [actions skip] workflows triggered on the push or pull_request events will be skipped.

But, as mentioned in issue 1313:

This doesn't disable whether checks are mandatory - nor is this something that we'll change.

There is a feature request:

This is possibly my single most wanted GitHub feature, by far.

It’s almost impossible to guarantee safety in a monorepo without conditionally required checks without adopting some kind of expensive workaround – either an automated expensive workaround, or a manually expensive workaround (e.g. folks becoming human linters, type checkers, and test suite validators on PR reviews like it’s 2009 again.

The end result is that we’ve ended up with a nasty habit of marking no conditional status checks as required, even though they really are required, which has led to folks prematurely merging things because we’ve gotten a bit too used to CI status being red on main, which isn’t ideal, to put it lightly.

See also "Required actions workflows from branch protections should only be required if run".

Also, just to clarify, this shouldn’t just be added in GitHub Actions, but rather at the GitHub level as an option for all required status checks, regardless of CI / CD provider.

  • Related