mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
Make sure that the changed files config values are an array
This commit is contained in:
10
dist/index.js
vendored
10
dist/index.js
vendored
@@ -273,8 +273,14 @@ function toChangedFilesMatchConfig(config) {
|
|||||||
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(element => {
|
changedFilesConfig.forEach(config => {
|
||||||
Object.assign(changedFilesMatchConfig.changedFiles, element);
|
// 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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,8 +173,14 @@ 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(element => {
|
changedFilesConfig.forEach(config => {
|
||||||
Object.assign(changedFilesMatchConfig.changedFiles, element);
|
// 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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user