mirror of
https://github.com/dorny/paths-filter.git
synced 2024-12-20 00:49:04 +00:00
Add minimal example to the top part of README
This commit is contained in:
parent
ff5bb057bf
commit
8b399ed168
19
README.md
19
README.md
@ -1,5 +1,4 @@
|
||||
|
||||
# paths-filter
|
||||
# Paths Changes Filter
|
||||
|
||||
This [Github Action](https://github.com/features/actions) enables conditional execution of workflow steps and jobs,
|
||||
based on the files modified by pull request, feature branch or in pushed commits.
|
||||
@ -24,8 +23,22 @@ doesn't allow this because they doesn't work on a level of individual jobs or st
|
||||
- Changes are detected against the most recent commit on the same branch before the push
|
||||
- Uses git commands to detect changes - repository must be already [checked out](https://github.com/actions/checkout)
|
||||
|
||||
## Example
|
||||
```yaml
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- 'src/**'
|
||||
|
||||
## Important notes:
|
||||
# run only if some file in 'src' folder was changed
|
||||
if: steps.changes.outputs.src == 'true'
|
||||
run: ...
|
||||
```
|
||||
For more scenarios see [examples](#examples) section.
|
||||
|
||||
## Notes:
|
||||
- Paths expressions are evaluated using [minimatch](https://github.com/isaacs/minimatch) library.
|
||||
Documentation for path expression format can be found on project github page.
|
||||
- Minimatch [dot](https://www.npmjs.com/package/minimatch#dot) option is set to true.
|
||||
|
@ -1,4 +1,4 @@
|
||||
name: 'Paths filter'
|
||||
name: 'Paths Changes Filter'
|
||||
description: 'Execute your workflow steps only if relevant files are modified.'
|
||||
author: 'Michal Dorner <dorner.michal@gmail.com>'
|
||||
inputs:
|
||||
|
Loading…
Reference in New Issue
Block a user