Skip to content

Commit

Permalink
Add minimal example to the top part of README
Browse files Browse the repository at this point in the history
  • Loading branch information
dorny committed Oct 1, 2020
1 parent ff5bb05 commit 8b399ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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/**'
# run only if some file in 'src' folder was changed
if: steps.changes.outputs.src == 'true'
run: ...
```
For more scenarios see [examples](#examples) section.

## Important notes:
## 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.
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 8b399ed

Please sign in to comment.