mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
Update object assignment in toChangedFilesMatchConfig
This commit is contained in:
@@ -61,16 +61,22 @@ export function toChangedFilesMatchConfig(
|
|||||||
} else {
|
} else {
|
||||||
// If it is not an array of strings then it should be array of further config options
|
// If it is not an array of strings then it should be array of further config options
|
||||||
// so assign them to our `changedFilesMatchConfig`
|
// so assign them to our `changedFilesMatchConfig`
|
||||||
Object.assign(
|
changedFilesMatchConfig.changedFiles = changedFilesConfig.reduce(
|
||||||
changedFilesMatchConfig.changedFiles,
|
(updatedMatchConfig, configValue) => {
|
||||||
...changedFilesConfig
|
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