mirror of
https://github.com/dorny/paths-filter.git
synced 2026-07-01 02:11:39 +00:00
Compare commits
4 Commits
9531691695
...
ada6cbfed8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ada6cbfed8 | ||
|
|
668c092af3 | ||
|
|
209e61402d | ||
|
|
9beb6f2184 |
28
README.md
28
README.md
@ -70,6 +70,34 @@ For more scenarios see [examples](#examples) section.
|
||||
- Local execution with [act](https://github.com/nektos/act) works only with alternative runner image. Default runner doesn't have `git` binary.
|
||||
- Use: `act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04`
|
||||
|
||||
### Schedule events (cron)
|
||||
|
||||
Workflows triggered by [`schedule` events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) (ie cron) must be given special consideration when using this action. As per the GitHub docs:
|
||||
|
||||
> Scheduled workflows run on the latest commit on the default or base branch
|
||||
|
||||
Unlike for `pull_request` or `push` events, where there's an associated commit (or set of commits) for the branch in question, schedule events are based on time, so there is nothing to compare against, other than maybe "the time of the last run", but that timing cannot be guaranteed.
|
||||
|
||||
As such, there is no GitHub Actions webhook payload for schedule events, so when the action tries to calculate the set of changes, it will error:
|
||||
|
||||
`This action requires 'base' input to be configured or 'repository.default_branch' to be set in the event payload`
|
||||
|
||||
It's recommended for workflows that will be triggered by a schedule event, to either set the `base` property, or explicitly check for a scheduled event and handle as required (eg always run, or never run, whatever the requirement is). For example, for steps within a single job:
|
||||
|
||||
```yaml
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: changes
|
||||
if: github.event_name != 'schedule'
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- 'src/**'
|
||||
|
||||
# run only if triggered by a schedule event, or some file in 'src' folder was changed
|
||||
- if: github.event_name == 'schedule' || steps.changes.outputs.src == 'true'
|
||||
run: ...
|
||||
```
|
||||
|
||||
## What's New
|
||||
|
||||
- New major release `v3` after update to Node 20 [Breaking change]
|
||||
|
||||
@ -44,6 +44,11 @@ inputs:
|
||||
This option takes effect only when changes are detected using git against different base branch.
|
||||
required: false
|
||||
default: '100'
|
||||
predicate-quantifier:
|
||||
description: |
|
||||
allows to override the "at least one pattern" behavior to make it so that all of the patterns have to match or otherwise the file is excluded.
|
||||
required: false
|
||||
default: 'some'
|
||||
outputs:
|
||||
changes:
|
||||
description: JSON array with names of all filters matching any of changed files
|
||||
|
||||
Loading…
Reference in New Issue
Block a user