Make sure that the changed files config values are an array

This commit is contained in:
Josh Dales
2023-02-19 18:10:19 -05:00
parent ed31b27f2e
commit da83a1845f
2 changed files with 16 additions and 4 deletions

10
dist/index.js vendored
View File

@@ -273,8 +273,14 @@ function toChangedFilesMatchConfig(config) {
else {
// If it is not an array of strings then it should be array of further config options
// so assign them to our `changedFilesMatchConfig`
changedFilesConfig.forEach(element => {
Object.assign(changedFilesMatchConfig.changedFiles, element);
changedFilesConfig.forEach(config => {
// Make sure that the values that we assign to our match config are an array
Object.entries(config).forEach(([key, value]) => {
const element = {
[key]: Array.isArray(value) ? value : [value]
};
Object.assign(changedFilesMatchConfig.changedFiles, element);
});
});
}
}