diff --git a/lib/actions/reconcile-issue.js b/lib/actions/reconcile-issue.js index acc03b1..6064499 100644 --- a/lib/actions/reconcile-issue.js +++ b/lib/actions/reconcile-issue.js @@ -34,7 +34,10 @@ async function reconcileIssue() { jiraBaseUrl: core.getInput("jiraBaseUrl", { required: true }), jiraToken: core.getInput("jiraToken", { required: true }), jiraProject: core.getInput("jiraProject", { required: true }), - requireMissingLabels: core.getInput("requireMissingLabels", { required: true }).split(","), + requireMissingLabels: core + .getInput("requireMissingLabels", { required: true }) + .split(",") + .map((element) => element.trim()), additionalLabels: core.getInput("additionalLabels").split(","), }; // First, make sure we are looking at the right thing. @@ -92,7 +95,7 @@ async function reconcileIssue() { } const requiredMissingLabels = inputs.requireMissingLabels.filter((label) => ghIssue.hasLabel(label)); if (requiredMissingLabels) { - core.info(`This issue has ${requiredMissingLabels} that indicate this issue is not triaged.`); + core.warning(`This issue has ${requiredMissingLabels} that indicate this issue is not triaged.`); return; } // jiraIssueParams are the primary fields we are concerned with updating diff --git a/lib/github-issue.js b/lib/github-issue.js index 611d78f..2b2f2ca 100644 --- a/lib/github-issue.js +++ b/lib/github-issue.js @@ -111,9 +111,7 @@ class GitHubIssue { }); } hasLabel(label) { - const labels = this.getLabels(); - core.debug(`Looking for label ${label} in ${labels}`); - return labels.includes(label); + return this.getLabels().includes(label); } hasLabelRegexp(regexp) { const labels = this.getLabels(); diff --git a/src/actions/reconcile-issue.ts b/src/actions/reconcile-issue.ts index fe8fa1d..a92649e 100644 --- a/src/actions/reconcile-issue.ts +++ b/src/actions/reconcile-issue.ts @@ -14,7 +14,10 @@ async function reconcileIssue() { jiraBaseUrl: core.getInput("jiraBaseUrl", { required: true }), jiraToken: core.getInput("jiraToken", { required: true }), jiraProject: core.getInput("jiraProject", { required: true }), - requireMissingLabels: core.getInput("requireMissingLabels", { required: true }).split(","), + requireMissingLabels: core + .getInput("requireMissingLabels", { required: true }) + .split(",") + .map((element) => element.trim()), additionalLabels: core.getInput("additionalLabels").split(","), }; @@ -81,10 +84,14 @@ async function reconcileIssue() { return; } - const requiredMissingLabels = inputs.requireMissingLabels.filter((label) => ghIssue.hasLabel(label)); + const requiredMissingLabels = inputs.requireMissingLabels.filter((label) => + ghIssue.hasLabel(label) + ); if (requiredMissingLabels) { - core.info(`This issue has ${requiredMissingLabels} that indicate this issue is not triaged.`); - return + core.warning( + `This issue has ${requiredMissingLabels} that indicate this issue is not triaged.` + ); + return; } // jiraIssueParams are the primary fields we are concerned with updating diff --git a/src/github-issue.ts b/src/github-issue.ts index e90b636..774e5ec 100644 --- a/src/github-issue.ts +++ b/src/github-issue.ts @@ -109,7 +109,6 @@ class GitHubIssue { }); } - // addComment creates a comment with ${body} async addComment(body: string) { await github.getOctokit(this.token).rest.issues.createComment({ @@ -121,9 +120,7 @@ class GitHubIssue { } hasLabel(label: string): boolean { - const labels = this.getLabels(); - core.debug(`Looking for label ${label} in ${labels}`); - return labels.includes(label); + return this.getLabels().includes(label); } hasLabelRegexp(regexp: RegExp): boolean {