You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-54
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Paths Changes Filter
2
2
3
-
This [Github Action](https://github.com/features/actions) enables conditional execution of workflow steps and jobs,
4
-
based on the files modified by pull request, feature branch or in pushed commits.
3
+
[Github Action](https://github.com/features/actions)that enables conditional execution of workflow steps and jobs, based on the files modified by pull request, on a feature
4
+
branch, or by the recently pushed commits.
5
5
6
-
It saves time and resources especially in monorepo setups, where you can run slow tasks (e.g. integration tests or deployments) only for changed components.
6
+
Run slow tasks like integration tests or deployments only for changed components. It saves time and resources, especially in monorepo setups.
# Git reference (e.g. branch name) from which the changes will be detected.
113
-
# Useful when workflow can be triggered only on default branch (e.g. repository_dispatch event)
114
-
# but you want to get changes on different branch.
111
+
# Useful when workflow can be triggered only on the default branch (e.g. repository_dispatch event)
112
+
# but you want to get changes on a different branch.
115
113
# This option is ignored if action is triggered by pull_request event.
116
114
# default: ${{ github.ref }}
117
115
ref:
118
116
119
-
# How many commits are initially fetched from base branch.
117
+
# How many commits are initially fetched from the base branch.
120
118
# If needed, each subsequent fetch doubles the
121
119
# previously requested number of commits until the merge-base
122
-
# is found or there are no more commits in the history.
120
+
# is found, or there are no more commits in the history.
123
121
# This option takes effect only when changes are detected
124
122
# using git against base branch (feature branch workflow).
125
123
# Default: 100
@@ -128,35 +126,35 @@ For more information see [CHANGELOG](https://github.com/dorny/paths-filter/blob/
128
126
# Enables listing of files matching the filter:
129
127
# 'none' - Disables listing of matching files (default).
130
128
# 'csv' - Coma separated list of filenames.
131
-
# If needed it uses double quotes to wrap filename with unsafe characters.
132
-
# 'json' - Matching files paths are formatted as JSON array.
133
-
# 'shell' - Space delimited list usable as commandline argument list in Linux shell.
134
-
# If needed it uses single or double quotes to wrap filename with unsafe characters.
135
-
# 'escape'- Space delimited list usable as commandline argument list in Linux shell.
129
+
# If needed, it uses double quotes to wrap filename with unsafe characters.
130
+
# 'json' - File paths are formatted as JSON array.
131
+
# 'shell' - Space delimited list usable as command-line argument list in Linux shell.
132
+
# If needed, it uses single or double quotes to wrap filename with unsafe characters.
133
+
# 'escape'- Space delimited list usable as command-line argument list in Linux shell.
136
134
# Backslash escapes every potentially unsafe character.
137
135
# Default: none
138
136
list-files: ''
139
137
140
138
# Relative path under $GITHUB_WORKSPACE where the repository was checked out.
141
139
working-directory: ''
142
140
143
-
# Personal access token used to fetch list of changed files
141
+
# Personal access token used to fetch a list of changed files
144
142
# from Github REST API.
145
-
# It's used only if action is triggered by pull request event.
143
+
# It's only used if action is triggered by a pull request event.
146
144
# Github token from workflow context is used as default value.
147
-
# If empty string is provided, action falls back to detect
145
+
# If an empty string is provided, the action falls back to detect
148
146
# changes using git commands.
149
147
# Default: ${{ github.token }}
150
148
token: ''
151
149
```
152
150
153
151
## Outputs
154
-
- For each filter it sets output variable named by the filter to the text:
152
+
- For each filter, it sets output variable named by the filter to the text:
155
153
- `'true'`- if **any** of changed files matches any of filter rules
156
154
- `'false'`- if **none** of changed files matches any of filter rules
157
-
- For each filter it sets output variable with name `${FILTER_NAME}_count` to the count of matching files.
158
-
- If enabled, for each filter it sets output variable with name `${FILTER_NAME}_files`. It will contain list of all files matching the filter.
159
-
- `changes`- JSON array with names of all filters matching any of changed files.
155
+
- For each filter, it sets an output variable with the name `${FILTER_NAME}_count` to the count of matching files.
156
+
- If enabled, for each filter it sets an output variable with the name `${FILTER_NAME}_files`. It will contain a list of all files matching the filter.
157
+
- `changes`- JSON array with names of all filters matching any of the changed files.
160
158
161
159
# Examples
162
160
@@ -283,7 +281,7 @@ jobs:
283
281
```yaml
284
282
on:
285
283
pull_request:
286
-
branches: # PRs to following branches will trigger the workflow
284
+
branches: # PRs to the following branches will trigger the workflow
287
285
- master
288
286
- develop
289
287
jobs:
@@ -329,7 +327,7 @@ jobs:
329
327
```yaml
330
328
on:
331
329
push:
332
-
branches: # Push to following branches will trigger the workflow
330
+
branches: # Push to the following branches will trigger the workflow
333
331
- master
334
332
- develop
335
333
- release/**
@@ -341,8 +339,8 @@ jobs:
341
339
- uses: dorny/paths-filter@v2
342
340
id: filter
343
341
with:
344
-
# Use context to get branch where commits were pushed.
345
-
# If there is only one longlived branch (e.g. master),
342
+
# Use context to get the branch where commits were pushed.
343
+
# If there is only one long-lived branch (e.g. master),
346
344
# you can specify it directly.
347
345
# If it's not configured, the repository default branch is used.
348
346
base: ${{ github.ref }}
@@ -366,11 +364,11 @@ jobs:
366
364
steps:
367
365
- uses: actions/checkout@v2
368
366
369
-
# Some action which modifies files tracked by git (e.g. code linter)
367
+
# Some action that modifies files tracked by git (e.g. code linter)
370
368
- uses: johndoe/some-action@v1
371
369
372
370
# Filter to detect which files were modified
373
-
# Changes could be for example automatically committed
371
+
# Changes could be, for example, automatically committed
374
372
- uses: dorny/paths-filter@v2
375
373
id: filter
376
374
with:
@@ -421,10 +419,10 @@ jobs:
421
419
id: filter
422
420
with:
423
421
# Changed file can be 'added', 'modified', or 'deleted'.
424
-
# By default the type of change is not considered.
425
-
# Optionally it's possible to specify it using nested
426
-
# dictionary, where type(s) of change composes the key.
427
-
# Multiple change types can be specified using `|` as delimiter.
422
+
# By default, the type of change is not considered.
423
+
# Optionally, it's possible to specify it using nested
424
+
# dictionary, where the type of change composes the key.
425
+
# Multiple change types can be specified using `|` as the delimiter.
428
426
filters: |
429
427
shared: &shared
430
428
- common/**
@@ -451,7 +449,7 @@ jobs:
451
449
# Enable listing of files matching each filter.
452
450
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
453
451
# Paths will be escaped and space-delimited.
454
-
# Output is usable as commandline argument list in Linux shell
452
+
# Output is usable as command-line argument list in Linux shell
455
453
list-files: shell
456
454
457
455
# In this example changed files will be checked by linter.
@@ -478,7 +476,7 @@ jobs:
478
476
# Paths will be formatted as JSON array
479
477
list-files: json
480
478
481
-
# In this example all changed files are passed to following action to do
479
+
# In this example all changed files are passed to the following action to do
0 commit comments