Status checks "required if run" #26092
-
TL;DRIs it somehow possible to change the branch protection from status checks that are required to “required if run”? I heavily make use of the
for my different workflows for GitHub Actions. Thus, depending on what files were changed in the PR a different set of checks is run. I would mark most (if not all) of them as required before a PR is merged. Problem is, if I do that the PR also waits for checks that will not be run. Is it somehow possible to change this behavior so that a check is marked as required only if it is run? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @pmeier, I’m afraid it’s not supported. If the checkrun is required, it has to be completed and return a status value. The only exception is if you’re an administrator, you can still merge the pull request. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hm, that is unfortunate. Problem with you approach is that the PR is marked as “not completed yet (yellow dot)” or failed forever, although that is not the case. I guess I’ll remove the branch protection rules in that case. Thanks for your input. |
Beta Was this translation helpful? Give feedback.
-
Yes this is a real shame. I’d like a “all tests run must pass” option, rather than a “these tests must run and pass (even though some of them may not be automatically started nor be relevant)” option. |
Beta Was this translation helpful? Give feedback.
-
any new update on this? |
Beta Was this translation helpful? Give feedback.
-
@pmeier @ayushxx7 You could try this workaround:
This way some check will run, and the rest will be |
Beta Was this translation helpful? Give feedback.
-
Just found out this wasn't supported. This is incompatible with monorepos. |
Beta Was this translation helpful? Give feedback.
Hi @pmeier,
I’m afraid it’s not supported. If the checkrun is required, it has to be completed and return a status value.
The only exception is if you’re an administrator, you can still merge the pull request.
Thanks.