Allow required checks to pass/skip, not fail, when using path filtering #44490
Replies: 20 comments 14 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.
-
|
Another way to "workaround" this Github deficiency is to use NX for monorepos. It uses a dependency graph to keep track of what "modules" changed in a monorepo so its cli is smart enough to only run commands (test, build, lint, etc.) related to those changed modules (or modules that depend on a changed module). |
Beta Was this translation helpful? Give feedback.
-
|
Hey @nebuk89, could you please update us if we should wait this feature in the next 6 month? |
Beta Was this translation helpful? Give feedback.
-
|
they want you to pay hidden cost for normal feature.. |
Beta Was this translation helpful? Give feedback.
-
|
I've been following this discussion for over a year now, and I keep coming back to it because it's directly affecting our workflow decisions. I'm trying to make the case internally for moving from a multi-repo setup to a monorepo, but it's been difficult to justify when this kind of basic behavior around required checks and I'm genuinely curious how this is handled internally at GitHub. From the outside, this feels like a very common monorepo use case. |
Beta Was this translation helpful? Give feedback.
-
|
I ran into this same issue in my monorepo and ended up using a "bucket" job pattern combined with https://github.com/dorny/paths-filter that works pretty well. The idea is to add one extra job that always runs, lists all your conditional jobs as dependencies, and only fails if any of them actually failed (not skipped). Then you set just this one job as the required status check instead of the individual ones. jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
website: ${{ steps.changes.outputs.website }}
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v4
id: changes
with:
filters: |
website:
- 'apps/website/**'
backend:
- 'apps/backend/**'
build-website:
needs: detect-changes
if: needs.detect-changes.outputs.website == 'true'
runs-on: ubuntu-latest
steps:
- run: echo "building website..."
-
# Rest of your jobs...
required-checks-passed:
if: always()
needs:
[
build-website,
build-landing-page,
# ... rest of your jobs
]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure')
run: exit 1
Its not ideal that this workaround is even necessary, but it gets the job done until GitHub ships a proper fix. My workflow now looks like this.
Another cool thing about this is that we can now define our required workflows as code and not in the UI. We only need to set these two jobs are required, and then never look at the settings UI again.
|
Beta Was this translation helpful? Give feedback.
-
|
My biggest issue with this work around, is that it adds 2 jobs on all workflows that run for about 1-2seconds. Since Github action round up to a minute when pricing job duration that means you get charged 2min for all "skipped" workflows in the monorepo. |
Beta Was this translation helpful? Give feedback.
-
Not related to the Workflows per se, but there is "Require conversation resolution before merging", which description says:
Having something along the same lines with "Require ALL status checks to pass before merging" without selection of individual checks would solve the subject problem. Just 2c, but IMHO that would be easiest approach to the problem, both architectually (the minimal code change on GitHub side) and operationally (no complex configs on the end-user, i.e. our sides). |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
pathsrules, 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 + 1files 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
patchworkflows which are running.Hopefully we can have an option in the repository to specify if workflows can be skipped (by the
pathsfilters) 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