Run the build command

This commit is contained in:
Josh Dales
2023-03-25 17:24:52 -04:00
parent ef6ab1b64a
commit 62f22bdebe

18
dist/index.js vendored
View File

@@ -186,7 +186,19 @@ exports.toChangedFilesMatchConfig = toChangedFilesMatchConfig;
function printPattern(matcher) { function printPattern(matcher) {
return (matcher.negate ? '!' : '') + matcher.pattern; 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}`); core.debug(` matching patterns against file ${changedFile}`);
for (const matcher of matchers) { for (const matcher of matchers) {
core.debug(` - ${printPattern(matcher)}`); core.debug(` - ${printPattern(matcher)}`);
@@ -202,7 +214,7 @@ function checkAnyChangedFiles(changedFiles, globs) {
const matchers = globs.map(g => new minimatch_1.Minimatch(g)); const matchers = globs.map(g => new minimatch_1.Minimatch(g));
core.debug(` checking "any" patterns`); core.debug(` checking "any" patterns`);
for (const changedFile of changedFiles) { for (const changedFile of changedFiles) {
if (isMatch(changedFile, matchers)) { if (isAnyMatch(changedFile, matchers)) {
core.debug(` "any" patterns matched against ${changedFile}`); core.debug(` "any" patterns matched against ${changedFile}`);
return true; return true;
} }
@@ -215,7 +227,7 @@ function checkAllChangedFiles(changedFiles, globs) {
const matchers = globs.map(g => new minimatch_1.Minimatch(g)); const matchers = globs.map(g => new minimatch_1.Minimatch(g));
core.debug(` checking "all" patterns`); core.debug(` checking "all" patterns`);
for (const changedFile of changedFiles) { for (const changedFile of changedFiles) {
if (!isMatch(changedFile, matchers)) { if (!isAllMatch(changedFile, matchers)) {
core.debug(` "all" patterns did not match against ${changedFile}`); core.debug(` "all" patterns did not match against ${changedFile}`);
return false; return false;
} }