File tree Expand file tree Collapse file tree 3 files changed +18
-24
lines changed Expand file tree Collapse file tree 3 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Action to get paths and files changed in a Pull Request event and use these for
7
7
- Get list of files changed in a PR
8
8
9
9
## Usage
10
- <details ><summary ><strong > Get a list of paths to use in a matrix of jobs</strong ></summary >
10
+ <details ><summary ><strong > Get a list of paths to use in a matrix of jobs (v1) </strong ></summary >
11
11
12
12
``` yaml
13
13
name : ' PR Detect changes'
@@ -57,12 +57,10 @@ jobs:
57
57
58
58
| parameter | description |
59
59
| - | - |
60
- | paths_changed | List of changed paths, example :
61
- ` ` ` ["dist", "dist/data"] ` ` `
62
- |
63
- | file_changed | List of changed files, example :
64
- ` ` ` ["dist/main.tf", "dist/index.js"] ` ` `
65
- |
60
+ | paths_list | List of changed paths, example : ` ["dist", "dist/data"]` |
61
+ | file_list | List of changed files, example : ` ["dist/main.tf", "dist/index.js"]` |
62
+ | paths_str | List of changed paths separated by `,` example : ` "dist,dist/data"` |
63
+ | file_str | List of changed files separated by `,` example : ` "dist/main.tf,dist/index.js"` |
66
64
67
65
68
66
Original file line number Diff line number Diff line change @@ -13,20 +13,14 @@ inputs:
13
13
required : false
14
14
default : ${{ github.token }}
15
15
outputs :
16
- paths_changed :
17
- description : >
18
- List of changed paths, example:
19
-
20
- ```
21
- ["dist", "dist/data"]
22
- ```
23
- file_changed :
24
- description : >
25
- List of changed files, example:
26
-
27
- ```
28
- ["dist/main.tf", "dist/index.js"]
29
- ```
16
+ paths_list :
17
+ description : ' List of changed paths, example: `["dist", "dist/data"]`'
18
+ file_list :
19
+ description : ' List of changed files, example: `["dist/main.tf", "dist/index.js"]`'
20
+ paths_str :
21
+ description : ' List of changed paths separated by `,` example: `"dist,dist/data"`'
22
+ file_str :
23
+ description : ' List of changed files separated by `,` example: `"dist/main.tf,dist/index.js"`'
30
24
runs :
31
25
using : ' node16'
32
26
main : ' dist/index.js'
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ async function setOutputs(files) {
8
8
pathsChanged . push ( file . filename . split ( "/" ) . slice ( 0 , - 1 ) . join ( "/" ) )
9
9
filesChanged . push ( file . filename )
10
10
} )
11
- core . setOutput ( "paths_changed" , JSON . stringify ( [ ...new Set ( pathsChanged ) ] ) )
12
- core . setOutput ( "file_changed" , JSON . stringify ( filesChanged ) )
11
+ core . setOutput ( "paths_list" , JSON . stringify ( [ ...new Set ( pathsChanged ) ] ) )
12
+ core . setOutput ( "file_list" , JSON . stringify ( [ ...new Set ( filesChanged ) ] ) )
13
+ core . setOutput ( "paths_str" , [ ...new Set ( pathsChanged ) ] . join ( ) )
14
+ core . setOutput ( "file_str" , [ ...new Set ( filesChanged ) ] . join ( ) )
13
15
}
14
16
15
17
const main = async ( ) => {
@@ -33,7 +35,7 @@ const main = async () => {
33
35
} )
34
36
35
37
if ( filteredFiles . length === 0 ) {
36
- console . log ( "No matchs found." )
38
+ console . log ( "No matches found." )
37
39
console . log ( `Raw input: ${ path } ` )
38
40
console . log ( `Regex: ${ regExp . toString ( ) } ` )
39
41
}
You can’t perform that action at this time.
0 commit comments