mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 20:24:51 +00:00
Update debugging indentation on the branch checks
This commit is contained in:
18
dist/index.js
vendored
18
dist/index.js
vendored
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user