mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
Add check for empty objects in checkAll
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
label:
|
label:
|
||||||
- unknown: 'this-is-not-supported'
|
- all:
|
||||||
|
- unknown: 'this-is-not-supported'
|
||||||
|
|||||||
4
dist/index.js
vendored
4
dist/index.js
vendored
@@ -467,7 +467,9 @@ exports.checkAny = checkAny;
|
|||||||
// equivalent to "Array.every()" but expanded for debugging and clarity
|
// equivalent to "Array.every()" but expanded for debugging and clarity
|
||||||
function checkAll(matchConfigs, changedFiles) {
|
function checkAll(matchConfigs, changedFiles) {
|
||||||
core.debug(` checking "all" patterns`);
|
core.debug(` checking "all" patterns`);
|
||||||
if (!matchConfigs.length) {
|
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]))) {
|
||||||
core.debug(` no "all" patterns to check`);
|
core.debug(` no "all" patterns to check`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,13 @@ export function checkAll(
|
|||||||
changedFiles: string[]
|
changedFiles: string[]
|
||||||
): boolean {
|
): boolean {
|
||||||
core.debug(` checking "all" patterns`);
|
core.debug(` checking "all" patterns`);
|
||||||
if (!matchConfigs.length) {
|
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])
|
||||||
|
)
|
||||||
|
) {
|
||||||
core.debug(` no "all" patterns to check`);
|
core.debug(` no "all" patterns to check`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user