Set default output of filter if none are matched?
See original GitHub issueI would like to be able to set the default output if the list is empty.
Using the below as an example, I would like to be able to do two things.
- Set a default like
with.default: [src, server]
- Have an option to use all filters as the default if empty.
with.outputAllFilters: true
or something like that
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
java - Returning default value in method if there are no matches
I have a method that will find an operator and return the new position. But if there are no matches, i want it...
Read more >FILTER function - Microsoft Support
The FILTER function allows you to filter a range of data based on criteria you define. In the following example we used the...
Read more >How To Use the Python Filter Function - DigitalOcean
The first argument to filter() is a function, which we use to decide whether to include or filter out each item. The function...
Read more >Excel FILTER Function – How To Use
The FILTER function is an Excel function that lets you fetch or "filter" a data set based on the criteria supplied via an...
Read more >Filtering AWS CLI output - AWS Command Line Interface
The service only returns matching results which can speed up HTTP response times for large data sets. Client-side filtering is supported by the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@merlinpatt you can use same filters in an inverted approach where you seperate out both path to exculde and include under two filter and use if condition in github workflow to make the decision,like:
The common pattern combined with YAML anchors would likely work.
However, there is one more question I have to make sure it would work.
In my common pattern, I would like to include almost all of a top level folder and ignore a specific sublevel folder.
I can do this in
on.push
/on.pull_request
like below.Is there a way I can do similarly in the common pattern? Or does micromatch only support inclusion not exclusion?