Skip to content

Commit 91f356e

Browse files
committed
Added support to ignore a pattern of files
1 parent 80cbf1f commit 91f356e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ const parseFiles = (files) => {
195195
template: item.template === undefined ? TEMPLATE_DEFAULT : item.template,
196196
replace: item.replace === undefined ? REPLACE_DEFAULT : item.replace,
197197
deleteOrphaned: item.deleteOrphaned === undefined ? DELETE_ORPHANED_DEFAULT : item.deleteOrphaned,
198+
excludeFilePatterns: item.excludeFilePatterns === undefined ? [] : item.excludeFilePatterns,
198199
exclude: parseExclude(item.exclude, item.source)
199200
}
200201
}

src/helpers.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ export async function copy(src, dest, isDirectory, file) {
126126
return false
127127
}
128128
}
129+
130+
// Check if the file matches any of the excludeFilePatterns
131+
if (file.excludeFilePatterns.length > 0) {
132+
for (const pattern of file.excludeFilePatterns) {
133+
if (srcFile.match(pattern)) {
134+
core.debug(`Excluding file ${ srcFile } since it matches the excludeFilePattern ${ pattern }.`)
135+
return false
136+
}
137+
}
138+
}
139+
129140
return true
130141
}
131142

0 commit comments

Comments
 (0)