Update debugging indentation on the branch checks

This commit is contained in:
Josh Dales
2023-03-27 16:37:55 -04:00
parent 67604ee822
commit b1a2f85ed8
2 changed files with 18 additions and 18 deletions

18
dist/index.js vendored
View File

@@ -69,15 +69,15 @@ function checkAnyBranch(regexps, branchBase) {
core.debug(` no branch name`); core.debug(` no branch name`);
return false; return false;
} }
core.debug(` checking "branch" pattern against ${branchName}`); core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp)); const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) { for (const matcher of matchers) {
if (matchBranchPattern(matcher, branchName)) { if (matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns matched against ${branchName}`); core.debug(` "branch" patterns matched against ${branchName}`);
return true; return true;
} }
} }
core.debug(` "branch" patterns did not match against ${branchName}`); core.debug(` "branch" patterns did not match against ${branchName}`);
return false; return false;
} }
exports.checkAnyBranch = checkAnyBranch; exports.checkAnyBranch = checkAnyBranch;
@@ -87,25 +87,25 @@ function checkAllBranch(regexps, branchBase) {
core.debug(` no branch name`); core.debug(` no branch name`);
return false; return false;
} }
core.debug(` checking "branch" pattern against ${branchName}`); core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp)); const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) { for (const matcher of matchers) {
if (!matchBranchPattern(matcher, branchName)) { if (!matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns did not match against ${branchName}`); core.debug(` "branch" patterns did not match against ${branchName}`);
return false; return false;
} }
} }
core.debug(` "branch" patterns matched against ${branchName}`); core.debug(` "branch" patterns matched against ${branchName}`);
return true; return true;
} }
exports.checkAllBranch = checkAllBranch; exports.checkAllBranch = checkAllBranch;
function matchBranchPattern(matcher, branchName) { function matchBranchPattern(matcher, branchName) {
core.debug(` - ${matcher}`); core.debug(` - ${matcher}`);
if (matcher.test(branchName)) { if (matcher.test(branchName)) {
core.debug(` "branch" pattern matched`); core.debug(` "branch" pattern matched`);
return true; return true;
} }
core.debug(` ${matcher} did not match`); core.debug(` ${matcher} did not match`);
return false; return false;
} }

View File

@@ -50,16 +50,16 @@ export function checkAnyBranch(
return false; return false;
} }
core.debug(` checking "branch" pattern against ${branchName}`); core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp)); const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) { for (const matcher of matchers) {
if (matchBranchPattern(matcher, branchName)) { if (matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns matched against ${branchName}`); core.debug(` "branch" patterns matched against ${branchName}`);
return true; return true;
} }
} }
core.debug(` "branch" patterns did not match against ${branchName}`); core.debug(` "branch" patterns did not match against ${branchName}`);
return false; return false;
} }
@@ -73,26 +73,26 @@ export function checkAllBranch(
return false; return false;
} }
core.debug(` checking "branch" pattern against ${branchName}`); core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp)); const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) { for (const matcher of matchers) {
if (!matchBranchPattern(matcher, branchName)) { if (!matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns did not match against ${branchName}`); core.debug(` "branch" patterns did not match against ${branchName}`);
return false; return false;
} }
} }
core.debug(` "branch" patterns matched against ${branchName}`); core.debug(` "branch" patterns matched against ${branchName}`);
return true; return true;
} }
function matchBranchPattern(matcher: RegExp, branchName: string): boolean { function matchBranchPattern(matcher: RegExp, branchName: string): boolean {
core.debug(` - ${matcher}`); core.debug(` - ${matcher}`);
if (matcher.test(branchName)) { if (matcher.test(branchName)) {
core.debug(` "branch" pattern matched`); core.debug(` "branch" pattern matched`);
return true; return true;
} }
core.debug(` ${matcher} did not match`); core.debug(` ${matcher} did not match`);
return false; return false;
} }