Required actions workflows from branch protections should only be required if run #13690
Replies: 49 comments 55 replies
-
|
Thanks @daltonv. I agree that this is not the ideal solution. I'll talk with the team that owns branch protection to give them your feedback. I'll also talk to the docs team to suggest some improvements for this article in the meantime. Thanks again for taking the time to leave feedback. |
Beta Was this translation helpful? Give feedback.
-
|
This should be a generalized change as it affects users who don't use GitHub Actions, but instead have third party CI/CD integrations triggered via webhooks. The option should simply be |
Beta Was this translation helpful? Give feedback.
-
|
See also the most active discussion in ye olde GitHub Community Forum on this topic: https://github.community/t/feature-request-conditional-required-checks/16761 |
Beta Was this translation helpful? Give feedback.
-
|
See also https://github.community/t/feature-request-required-checks-conditioned-on-path/2042 |
Beta Was this translation helpful? Give feedback.
-
|
Ran into it as well. Having something like this would also let us implement more straightforward skipping. For instance, I don't need to to spend the time running all our test, visual regressions, etc. on a PR from an internal bot that edits changelogs, but I absolutely want those to be required checks for us humans so we can use really helpful things like auto-merging, etc. |
Beta Was this translation helpful? Give feedback.
-
|
Very much want this, we spend piles of cash on GitHub because of this shortcoming. |
Beta Was this translation helpful? Give feedback.
-
|
+1. We have the same problem over at Keycloak: Multiple workflows / jobs are running for e.g. a simple typo in our documentation, or a bump in npm dependencies. Would be very nice to have better support than the dummy workflow approach. |
Beta Was this translation helpful? Give feedback.
-
|
Running into similar problem when using conditional workflow via circle-ci. It should not be waiting infinitely if the workflow doesn't run at all |
Beta Was this translation helpful? Give feedback.
-
|
+1, it's surprising that GitHub and disappointing that GitHub doesn't fully support a code first approach for the definition of requirements. The dummy workaround is hacky to say the least. |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
this is a real pain. any update on this? @ethomson |
Beta Was this translation helpful? Give feedback.
-
|
Hard not to see this as a cash grab, we've been asking for it for 3 years now, the only way to safely protect branches in this scenario is to run all checks always. |
Beta Was this translation helpful? Give feedback.
-
|
Came here to add to the chorus of programmers asking for help with this sad trombone UX. |
Beta Was this translation helpful? Give feedback.
-
|
I got the "dummy workflow workaround" working but it broke after about a week. I don't know if it was some internal Github change or if my setup is just fragile, but the whole situation is pretty disappointing nonetheless. |
Beta Was this translation helpful? Give feedback.
-
|
I've created a GitHub Action that wraps the logic of what @danieltroger described in a nicer package. Check it out at https://github.com/wechuli/allcheckspassed. It provides some additional options such as excluding certain checks from the evaluation and choosing what exactly constitutes a passing check (e.g. skipped, neutral). The action also creates a summary of the checks that were evaluated. Additional documentation is on the README. Ultimately this is only a workaround for a missing feature, the main downside it has is that you need to configure it on its own workflow and it will consume your Actions minutes, I have tried to document this under limitations section. Let me know what you think, if you want some features it doesn't have, please open an issue (or a pr 😉 ). |
Beta Was this translation helpful? Give feedback.
-
|
Just a note that https://github.com/palantir/policy-bot is a great option until github support this. Only real downside is the duplication of conditions between the policies and the conditional jobs imo. |
Beta Was this translation helpful? Give feedback.
-
|
the way I solved this issue is by adding a job like the following to all the workflows. and a dummy workflow with the same job name that runs exit 0. I marked |
Beta Was this translation helpful? Give feedback.
-
|
We've actually used https://github.com/dorny/paths-filter to create conditional actions, based on paths, that still succeed in the end. Workflow runs, it decides if it needs to do the work, and then passes/fails based on the work. If it doesn't need to do the work, it skips the conditional job, and passes. |
Beta Was this translation helpful? Give feedback.
-
|
I tried the path filter action approach, and it’s been incredibly frustrating. The configuration goes like this:
Initially, this seemed like a reasonable solution, but it completely breaks down when you have even a slightly complex setup with job dependencies. For example, my CI has a build phase and a test phase, where the test phase has a matrix of runtime arguments. All these test jobs with different matrix values are marked as "required checks to pass." The issue arises when the file changes aren’t related to this CI. In such cases, I need to skip the build and test phases. If I use To hack around this, you can’t rely on path filtering in the workflow or job scope. Instead, you have to move the path filtering logic into steps. You check the output of the path filter job as a global variable, and in every job, the first step checks this variable. If the job needs to be skipped, you force a pass in the step itself, not in the job’s This approach is far more complicated than it should be. Something as basic as skipping jobs based on file changes shouldn’t require this level of convoluted hacking. It’s frustrating and feels like an overengineered solution for what should be a straightforward problem. |
Beta Was this translation helpful? Give feedback.
-
|
Hey, are any updates on this? Is the GitHub team planning to implement this feature? |
Beta Was this translation helpful? Give feedback.
-
|
Since 2022, this glaring issue has remained unresolved and unimplemented. This is not a feature request; it’s a genuine problem. While I was initially pleased with the migration to GitHub, we’ve encountered numerous frustrating obstacles that defy explanation. This issue is one of them. Others include the lack of support for proper required reviews (such as supporting only OR in codeowners files, extremely limited path filters. |
Beta Was this translation helpful? Give feedback.
-
Agreed requiring a workflow that never runs due to path filtering is counterproductive. GitHub should make required checks conditional on whether the workflow actually triggers, instead of forcing dummy workflows that clutter the Actions list. |
Beta Was this translation helpful? Give feedback.
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
👍 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
This is going to be a serious issue for us trying to migrate from Azure DevOps to GitHub. We have several monorepos in ADO with various pipelines that are triggered or not based on what files changed (via build validation policies) and without the ability for github to only care about the checks that are relevant we'll have to implement a lot of hacky shit to make it work, or more likely just not migrate. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Duplicate of #44490 ? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
If you have branch protections set so that a GitHub Action workflow must be run and pass before you can merge, and this workflow has path filtering in the
on:clause then you sometimes can't ever merge because the workflow doesn't run.This GitHub docs talk about this issue here: https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
There is a workaround suggested in the doc article, but it involves making a "dummy" workflow of the same name of the required workflow. This dummy workflow always passes and is triggered by the inverse path filtering of the required workflow.
This isn't the best solution in my mind because:
Instead it should be changed so local workflows are only required if they run in the first place.
Beta Was this translation helpful? Give feedback.
All reactions