Skip to content

Commit

Permalink
Make sure that the changed files config values are an array
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdales committed Feb 19, 2023
1 parent ed31b27 commit da83a18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/labeler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,14 @@ function toChangedFilesMatchConfig(config: any): ChangedFilesMatchConfig {
} 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);
});
});
}
}
Expand Down

0 comments on commit da83a18

Please sign in to comment.