mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 20:24:51 +00:00
Condense assignment of further config options in toChangedFilesMatchConfig
This commit is contained in:
@@ -175,14 +175,15 @@ function toChangedFilesMatchConfig(config: any): ChangedFilesMatchConfig {
|
|||||||
} 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`
|
||||||
changedFilesConfig.forEach(config => {
|
Object.assign(
|
||||||
// Make sure that the values that we assign to our match config are an array
|
changedFilesMatchConfig.changedFiles,
|
||||||
Object.entries(config).forEach(([key, value]) => {
|
...changedFilesConfig
|
||||||
const element = {
|
);
|
||||||
[key]: Array.isArray(value) ? value : [value]
|
Object.keys(changedFilesMatchConfig.changedFiles).forEach(key => {
|
||||||
};
|
const value = changedFilesMatchConfig.changedFiles[key];
|
||||||
Object.assign(changedFilesMatchConfig.changedFiles, element);
|
changedFilesMatchConfig.changedFiles[key] = Array.isArray(value)
|
||||||
});
|
? value
|
||||||
|
: [value];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user