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