mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 03:58:05 +00:00
Update object assignment in toChangedFilesMatchConfig
This commit is contained in:
@@ -61,16 +61,22 @@ export function toChangedFilesMatchConfig(
|
||||
} else {
|
||||
// If it is not an array of strings then it should be array of further config options
|
||||
// so assign them to our `changedFilesMatchConfig`
|
||||
Object.assign(
|
||||
changedFilesMatchConfig.changedFiles,
|
||||
...changedFilesConfig
|
||||
changedFilesMatchConfig.changedFiles = changedFilesConfig.reduce(
|
||||
(updatedMatchConfig, configValue) => {
|
||||
if (!configValue) {
|
||||
return updatedMatchConfig;
|
||||
}
|
||||
|
||||
Object.entries(configValue).forEach(([key, value]) => {
|
||||
if (key === 'any' || key === 'all') {
|
||||
updatedMatchConfig[key] = Array.isArray(value) ? value : [value];
|
||||
}
|
||||
});
|
||||
|
||||
return updatedMatchConfig;
|
||||
},
|
||||
{}
|
||||
);
|
||||
Object.keys(changedFilesMatchConfig.changedFiles).forEach(key => {
|
||||
const value = changedFilesMatchConfig.changedFiles[key];
|
||||
changedFilesMatchConfig.changedFiles[key] = Array.isArray(value)
|
||||
? value
|
||||
: [value];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user