mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
Don't allow empty changed-files objects through
This commit is contained in:
@@ -54,7 +54,10 @@ export function toChangedFilesMatchConfig(
|
||||
};
|
||||
|
||||
if (Array.isArray(changedFilesConfig)) {
|
||||
if (changedFilesConfig.every(entry => typeof entry === 'string')) {
|
||||
if (
|
||||
changedFilesConfig.length &&
|
||||
changedFilesConfig.every(entry => typeof entry === 'string')
|
||||
) {
|
||||
changedFilesMatchConfig.changedFiles = {
|
||||
any: changedFilesConfig
|
||||
};
|
||||
@@ -80,6 +83,11 @@ export function toChangedFilesMatchConfig(
|
||||
}
|
||||
}
|
||||
|
||||
// If no items were added to `changedFiles` then return an empty object
|
||||
if (!Object.keys(changedFilesMatchConfig.changedFiles).length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return changedFilesMatchConfig;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user