Allow required checks to pass/skip, not fail, when using path filtering #44490
Replies: 9 comments 4 replies
-
Another approach might be to allow similar path filtering on the required tests. |
Beta Was this translation helpful? Give feedback.
-
We're seeing the same issue in our monorepo. We have over 20 services and libraries, each with their own workflows, and a collection of reusable workflows (for tests, Docker builds, deployments). Initially, we were using the native path filtering to only run the workflows of changed services, but as we discovered GitHub Actions doesn't support path filters when using required checks, as each required check will sit there and not be marked as skipped, thus blocking the PR from merging. Additionally, we are also using the merge queue, so required checks are absolutely necessary. We found an alternative using We've also tried to create a "master" workflow that would run a single path filter check, and execute each workflow service as a reusable workflow depending on the result of the path filter check. Thus costing us only 1 minute per commit instead of 23. However, we've now reached another GitHub Actions limit, where a workflow cannot reference more than 20 reusable workflows. I really hope that GitHub fixes this very basic use case of not supporting path filters and required checks together. |
Beta Was this translation helpful? Give feedback.
-
Also ran into this issue today +1 for a feature/fix from Github to address this issue. |
Beta Was this translation helpful? Give feedback.
-
I just create a action pull-request-path-filter as a workaround. But it only works for pull request event. |
Beta Was this translation helpful? Give feedback.
-
Wow not a peep from GitHub. I'm beginning to think this entire community is a honeypot. |
Beta Was this translation helpful? Give feedback.
-
solutions works but are is very inefficient, lots of status checks running for nothing, lot of compute waste and time wasted. |
Beta Was this translation helpful? Give feedback.
-
Would also love a native solution for this. I implemented @MarcDufresne's solution with the file filters action. It works fine but results in a lot of unnecessary compute and therefore money wasted. Not needing a required check to run would make it so much nicer for mono repos. |
Beta Was this translation helpful? Give feedback.
-
Hey! Sorry I missed this one as we are going through triaging the backlog of community bits :) I don't have a timeline for this one, but will add it to the list of papercuts we are working through to ensure it's considered as we try to burn these down over the next 12 months. Thanks for your patience and engagement <3 please keep sharing with us 🙏 |
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.
-
Select Topic Area
Product Feedback
Body
As a repository starts to grow and depends more and more on GitHub Actions for CI, it also becomes more necessary to make workflows required.
Not being able to skip a required action, if it was filtered by
paths
rules, creates a burden for developers/DevOps maintaining extra files in sync with the original workflow.For example, any coding language with a CI pipeline will evaluate if any file having the specified language in it was changed, and if not, it will skip the workflow:
The offered workaround in the official documentation is to create another workflow, ignoring the path and including each step with a script to return the correct exit code: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
This is far from optimal, as it create
N + 1
files for each required workflow, and it requires to create each step in the extra workflow. While keeping them in sync if any extra step is added in the original workflow.This also doubles the checks in the PR UI, and does not allow to understand which workflows were run and which were not.
This workflow directory is an example of the burden created by this workaround https://github.com/ZcashFoundation/zebra/tree/main/.github/workflows and any PR will show like all workflows are run, but this are just the
patch
workflows which are running.Hopefully we can have an option in the repository to specify if workflows can be skipped (by the
paths
filters) even if the workflow is required.Note: This discussion refers to the same issue, but it was marked as answered with a different workaround which won't work on repositories like ours, as it creates extra steps, dependencies and complexity: https://github.com/orgs/community/discussions/26857#discussioncomment-3253667
Beta Was this translation helpful? Give feedback.
All reactions