From 62f22bdebe66c808baa915a3f9a0a74e80ae82e2 Mon Sep 17 00:00:00 2001 From: Josh Dales Date: Sat, 25 Mar 2023 17:24:52 -0400 Subject: [PATCH] Run the build command --- dist/index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index fda0b69d..8de593f7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -186,7 +186,19 @@ exports.toChangedFilesMatchConfig = toChangedFilesMatchConfig; function printPattern(matcher) { return (matcher.negate ? '!' : '') + matcher.pattern; } -function isMatch(changedFile, matchers) { +function isAnyMatch(changedFile, matchers) { + core.debug(` matching patterns against file ${changedFile}`); + for (const matcher of matchers) { + core.debug(` - ${printPattern(matcher)}`); + if (matcher.match(changedFile)) { + core.debug(` ${printPattern(matcher)} matched`); + return true; + } + } + core.debug(` no patterns matched`); + return false; +} +function isAllMatch(changedFile, matchers) { core.debug(` matching patterns against file ${changedFile}`); for (const matcher of matchers) { core.debug(` - ${printPattern(matcher)}`); @@ -202,7 +214,7 @@ function checkAnyChangedFiles(changedFiles, globs) { const matchers = globs.map(g => new minimatch_1.Minimatch(g)); core.debug(` checking "any" patterns`); for (const changedFile of changedFiles) { - if (isMatch(changedFile, matchers)) { + if (isAnyMatch(changedFile, matchers)) { core.debug(` "any" patterns matched against ${changedFile}`); return true; } @@ -215,7 +227,7 @@ function checkAllChangedFiles(changedFiles, globs) { const matchers = globs.map(g => new minimatch_1.Minimatch(g)); core.debug(` checking "all" patterns`); for (const changedFile of changedFiles) { - if (!isMatch(changedFile, matchers)) { + if (!isAllMatch(changedFile, matchers)) { core.debug(` "all" patterns did not match against ${changedFile}`); return false; }