mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 03:58:05 +00:00
Get all the tests passings
This commit is contained in:
@@ -63,7 +63,6 @@ function isMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
// equivalent to "Array.some()" but expanded for debugging and clarity
|
||||
export function checkAnyChangedFiles(
|
||||
changedFiles: string[],
|
||||
globs: string[]
|
||||
@@ -81,7 +80,6 @@ export function checkAnyChangedFiles(
|
||||
return false;
|
||||
}
|
||||
|
||||
// equivalent to "Array.every()" but expanded for debugging and clarity
|
||||
export function checkAllChangedFiles(
|
||||
changedFiles: string[],
|
||||
globs: string[]
|
||||
|
||||
@@ -167,7 +167,9 @@ export function getLabelConfigMapFromObject(
|
||||
[]
|
||||
);
|
||||
|
||||
labelMap.set(label, matchConfigs);
|
||||
if (matchConfigs.length) {
|
||||
labelMap.set(label, matchConfigs);
|
||||
}
|
||||
}
|
||||
|
||||
return labelMap;
|
||||
@@ -203,16 +205,14 @@ function checkMatch(changedFiles: string[], matchConfig: MatchConfig): boolean {
|
||||
}
|
||||
|
||||
if (matchConfig.all) {
|
||||
// check the options and if anything fails then return false
|
||||
if (!checkAll(matchConfig.all, changedFiles)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchConfig.any) {
|
||||
// Check all the various options if any pass return true
|
||||
if (checkAny(matchConfig.any, changedFiles)) {
|
||||
return true;
|
||||
if (!checkAny(matchConfig.any, changedFiles)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,6 +225,11 @@ export function checkAny(
|
||||
changedFiles: string[]
|
||||
): boolean {
|
||||
core.debug(` checking "any" patterns`);
|
||||
if (!Object.keys(matchConfigs).length) {
|
||||
core.debug(` no "any" patterns to check`);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const matchConfig of matchConfigs) {
|
||||
if (matchConfig.baseBranch) {
|
||||
if (checkAnyBranch(matchConfig.baseBranch, 'base')) {
|
||||
@@ -255,6 +260,11 @@ export function checkAll(
|
||||
changedFiles: string[]
|
||||
): boolean {
|
||||
core.debug(` checking "all" patterns`);
|
||||
if (!Object.keys(matchConfigs).length) {
|
||||
core.debug(` no "all" patterns to check`);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const matchConfig of matchConfigs) {
|
||||
if (matchConfig.baseBranch) {
|
||||
if (!checkAllBranch(matchConfig.baseBranch, 'base')) {
|
||||
|
||||
Reference in New Issue
Block a user