@@ -5,26 +5,34 @@ const { getStatsDiff } = require('webpack-stats-diff')
55
66const getInputs = ( ) => ( {
77 basePath : core . getInput ( 'base_path' ) ,
8- prPath : core . getInput ( 'pr_path' )
8+ prPath : core . getInput ( 'pr_path' ) ,
9+ excludedAssets : core . getInput ( 'excluded_assets' )
910} )
1011
1112const checkPaths = async ( ) => {
12- const { basePath, prPath } = getInputs ( )
13+ const { basePath, prPath, excludedAssets } = getInputs ( )
1314 const base = path . resolve ( process . cwd ( ) , basePath )
1415 const pr = path . resolve ( process . cwd ( ) , prPath )
1516
1617 const baseInclude = require ( base )
17- const baseAssets = baseInclude && baseInclude . assets
18+ let baseAssets = baseInclude && baseInclude . assets
1819 if ( ! baseAssets ) {
1920 throw new Error ( `Base path is not correct. Current input: ${ base } ` )
2021 }
2122
2223 const prInclude = require ( pr )
23- const prAssets = prInclude && prInclude . assets
24+ let prAssets = prInclude && prInclude . assets
2425 if ( ! prAssets ) {
2526 throw new Error ( `Pr path is not correct. Current input: ${ pr } ` )
2627 }
2728
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+
2836 return {
2937 base : baseAssets ,
3038 pr : prAssets
0 commit comments