Allow required checks to pass/skip, not fail, when using path filtering #44490
-
Select Topic AreaProduct Feedback BodyAs 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 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: name: CI
on:
pull_request:
paths:
- '**/*.py' 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 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 Hopefully we can have an option in the repository to specify if workflows can be skipped (by the 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.
Replies: 13 comments 6 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.
-
Would love an update on this. Being able to skip checks in CI is a critical feature to help save time and compute costs. The existing solutions are all quite hacky, and an official solution would be very appreciated. |
Beta Was this translation helpful? Give feedback.
-
@nebuk89 we're shifting our cloudbuild triggers over to github actions and so far the experience has been very positive! We are also coming up against this issue. Ideally we want to complete the migration by EOQ. Any chance of an update on prioritisation at least? |
Beta Was this translation helpful? Give feedback.
-
GitHub Actions does bill by rounding up to the nearest minute for each job, not by the second. This means even if a job only runs for a few seconds (like 4-6 seconds), it will be billed as a full minute. I wonder what revenue GitHub will lose if them implement this? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Basic functionality, honestly. Any ETA? |
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 🙏