Feature request: conditional required checks

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 like in @jffaust’s message, 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 :cry:). 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 :negative_squared_cross_mark: on main, which isn’t ideal, to put it lightly. :sweat_smile:

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.

3 Likes

With monorepos increasing in popularity, this is not just a nice-to-have, but a must.

The status checks is a required dependency of the “This branch is out-of-date with the base branch” feature, i.e it only has effect if at least at least one status check is enabled.

I just hit a very hard to debug issue where I my CI lockfile was failing because it had been upgraded by Dependabot, and it wasn’t clear at all what was the problem as I didn’t realize that my branch was out-of-date with the base. As a workaround, I’ll have to create a dummy action and require it, to at least have the out-of-date alert.

1 Like

@mchevy422 is Github tracking the demand/impact of this improvement somewhere? Is it helpful liking the original post or is it anyhow disconnected from your internal tracking systems?

Thanks,
Harald

1 Like

I managed to achieve this with the dorny/paths-filter action. If you split them as jobs rather than steps, the advantage is you don’t even need to checkout the code when the actions don’t have to run. The result is the actions show up in the checklist but marked as skipped, so you can mark them all as required but they won’t run.

Example:

2 Likes

@mchevy422 does GitHub have any plans to implement this? Without this, monorepos need to have a huge number of meaningless actions on every PR that essentially do nothing but waste money for everybody… or is that the point of not fixing it?

Agreed. This is essential for monorepos.

For my team’s needs, we just need to specify a glob for each “required” check. Our CI/CD platform (not Actions) is already smart enough to not run checks unless they match a glob. We just need to add the same glob on the GitHub side so that we can require the check only if a file matching the glob is being changed in the given PR.

1 Like