@@ -5,26 +5,34 @@ const { getStatsDiff } = require('webpack-stats-diff')
5
5
6
6
const getInputs = ( ) => ( {
7
7
basePath : core . getInput ( 'base_path' ) ,
8
- prPath : core . getInput ( 'pr_path' )
8
+ prPath : core . getInput ( 'pr_path' ) ,
9
+ excludedAssets : core . getInput ( 'excluded_assets' )
9
10
} )
10
11
11
12
const checkPaths = async ( ) => {
12
- const { basePath, prPath } = getInputs ( )
13
+ const { basePath, prPath, excludedAssets } = getInputs ( )
13
14
const base = path . resolve ( process . cwd ( ) , basePath )
14
15
const pr = path . resolve ( process . cwd ( ) , prPath )
15
16
16
17
const baseInclude = require ( base )
17
- const baseAssets = baseInclude && baseInclude . assets
18
+ let baseAssets = baseInclude && baseInclude . assets
18
19
if ( ! baseAssets ) {
19
20
throw new Error ( `Base path is not correct. Current input: ${ base } ` )
20
21
}
21
22
22
23
const prInclude = require ( pr )
23
- const prAssets = prInclude && prInclude . assets
24
+ let prAssets = prInclude && prInclude . assets
24
25
if ( ! prAssets ) {
25
26
throw new Error ( `Pr path is not correct. Current input: ${ pr } ` )
26
27
}
27
28
29
+ if ( excludedAssets ) {
30
+ const regex = new RegExp ( excludedAssets )
31
+ baseAssets = baseAssets . filter ( asset => ! asset . name . match ( regex ) )
32
+ prAssets = prAssets . filter ( asset => ! asset . name . match ( regex ) )
33
+ }
34
+
35
+
28
36
return {
29
37
base : baseAssets ,
30
38
pr : prAssets
0 commit comments