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
+40-9
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Paths Changes Filter
1
+
# Paths Changes Filter And Diff Stat
2
2
3
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
4
branch, or by the recently pushed commits.
@@ -7,6 +7,8 @@ Run slow tasks like integration tests or deployments only for changed components
don't allow this because they don't work on a level of individual jobs or steps.
9
9
10
+
This is a fork of [dorny/paths-filter](https://github.com/dorny/paths-filter) that adds the feature of diff stat output. The reason behind forking is that original project is dormant.
@@ -73,13 +75,14 @@ For more scenarios see [examples](#examples) section.
73
75
## What's New
74
76
75
77
- New major release `v3` after update to Node 20 [Breaking change]
78
+
- Add `stat` parameter that enables output of the file changes statistics per filter.
76
79
- Add `ref` input parameter
77
80
- Add `list-files: csv` format
78
81
- Configure matrix job to run for each folder with changes using `changes` output
79
82
- Improved listing of matching files with `list-files: shell` and `list-files: escape` options
80
83
- Paths expressions are now evaluated using [picomatch](https://github.com/micromatch/picomatch) library
81
84
82
-
For more information, see [CHANGELOG](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
85
+
For more information, see [CHANGELOG](https://github.com/lykahb/paths-filter/blob/master/CHANGELOG.md)
83
86
84
87
## Usage
85
88
@@ -154,14 +157,14 @@ For more information, see [CHANGELOG](https://github.com/dorny/paths-filter/blob
154
157
# Default: ${{ github.token }}
155
158
token: ''
156
159
157
-
# Optional parameter to override the default behavior of file matching algorithm.
160
+
# Optional parameter to override the default behavior of file matching algorithm.
158
161
# By default files that match at least one pattern defined by the filters will be included.
159
162
# This parameter allows to override the "at least one pattern" behavior to make it so that
160
-
# all of the patterns have to match or otherwise the file is excluded.
161
-
# An example scenario where this is useful if you would like to match all
162
-
# .ts files in a sub-directory but not .md files.
163
-
# The filters below will match markdown files despite the exclusion syntax UNLESS
164
-
# you specify 'every' as the predicate-quantifier parameter. When you do that,
163
+
# all of the patterns have to match or otherwise the file is excluded.
164
+
# An example scenario where this is useful if you would like to match all
165
+
# .ts files in a sub-directory but not .md files.
166
+
# The filters below will match markdown files despite the exclusion syntax UNLESS
167
+
# you specify 'every' as the predicate-quantifier parameter. When you do that,
165
168
# it will only match the .ts files in the subdirectory as expected.
166
169
#
167
170
# backend:
@@ -179,6 +182,7 @@ For more information, see [CHANGELOG](https://github.com/dorny/paths-filter/blob
179
182
- For each filter, it sets an output variable with the name `${FILTER_NAME}_count` to the count of matching files.
180
183
- 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.
181
184
- `changes`- JSON array with names of all filters matching any of the changed files.
185
+
- If `stat` input is set to an output format, the output variable `stat` contains JSON or CSV value with the change statistics for each filter.
182
186
183
187
## Examples
184
188
@@ -558,10 +562,37 @@ jobs:
558
562
559
563
</details>
560
564
565
+
<details>
566
+
<summary>Passing number of added lines from a filter to another action</summary>
567
+
568
+
```yaml
569
+
- uses: dorny/paths-filter@v2
570
+
id: filter
571
+
with:
572
+
# Enable listing of diff stat matching each filter.
573
+
# Paths to files will be available in `stat` output variable.
574
+
# Stat will be formatted as JSON object
575
+
stat: json
576
+
577
+
# In this example all changed files are passed to the following action to do
Backslash escapes every potentially unsafe character.
37
37
required: false
38
38
default: none
39
+
stat:
40
+
description: |
41
+
Enables listing of that enables output of the file change statistics per filter, similar to `git diff --shortstat`.
42
+
If some changes do not match any filter, the output includes an additional entry with the filter name 'other'.
43
+
'none' - Disables listing of stats (default).
44
+
'csv' - Coma separated list that has name of filter, count of additions, count of deletions, count of changed files.
45
+
If needed it uses double quotes to wrap name of filter with unsafe characters. For example, `"some filter",12,7,2`.
46
+
'json' - Serialized as JSON object where the filter names are keys. For example, `{"some filter": {"additionCount": 12, "deletionCount": 7, "fileCount": 2}}`
47
+
required: false
48
+
default: none
39
49
initial-fetch-depth:
40
50
description: |
41
51
How many commits are initially fetched from base branch.
0 commit comments