mirror of
https://github.com/actions/labeler.git
synced 2025-12-13 13:07:24 +00:00
Better check for empty configs in checkAll
This commit is contained in:
@@ -225,7 +225,10 @@ export function checkAny(
|
||||
changedFiles: string[]
|
||||
): boolean {
|
||||
core.debug(` checking "any" patterns`);
|
||||
if (!matchConfigs.length) {
|
||||
if (
|
||||
!matchConfigs.length ||
|
||||
!matchConfigs.some(configOption => Object.keys(configOption).length)
|
||||
) {
|
||||
core.debug(` no "any" patterns to check`);
|
||||
return false;
|
||||
}
|
||||
@@ -262,10 +265,7 @@ export function checkAll(
|
||||
core.debug(` checking "all" patterns`);
|
||||
if (
|
||||
!matchConfigs.length ||
|
||||
// Make sure that all the configs have keys that we can check for
|
||||
!matchConfigs.some(configOption =>
|
||||
ALLOWED_CONFIG_KEYS.includes(Object.keys(configOption)[0])
|
||||
)
|
||||
!matchConfigs.some(configOption => Object.keys(configOption).length)
|
||||
) {
|
||||
core.debug(` no "all" patterns to check`);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user