diff --git a/.github/workflows/scripts/test-tag-parser.js b/.github/workflows/scripts/test-tag-parser.js index 7ee9abd878..87a5c801c3 100644 --- a/.github/workflows/scripts/test-tag-parser.js +++ b/.github/workflows/scripts/test-tag-parser.js @@ -18,9 +18,10 @@ function parseTags({core, context}) { for (const [rawTag] of config.matchAll(/\w+/g)) { console.log("Given: '" + rawTag + "'"); + const rawTagLowerAndPrefixed = "@tag." + rawTag.toLowerCase(); // See if there is exact case-insensitive match. - const exactTagMatch = allTags.find(t => t.toLowerCase() === "@tag." + rawTag); + const exactTagMatch = allTags.find(t => t.toLowerCase() === rawTagLowerAndPrefixed); if (exactTagMatch) { console.log("\tMatch found:", exactTagMatch); concreteTags.push(exactTagMatch); @@ -28,7 +29,7 @@ function parseTags({core, context}) { } // See if there is a singular/plural match (very rudimentary language skills). - const countedMatch = allTags.find(t => t.toLowerCase().replace(/s$/, "") === "@tag." + rawTag.replace(/s$/, "")); + const countedMatch = allTags.find(t => t.toLowerCase().replace(/s$/, "") === rawTagLowerAndPrefixed.replace(/s$/, "")); if (countedMatch) { console.log("\tMatch found:", countedMatch); concreteTags.push(countedMatch); @@ -38,7 +39,7 @@ function parseTags({core, context}) { // More smart matchers? // No match, fail. - core.setFailed("\tNo match found for tag:", rawTag); + core.setFailed("\tNo match found for tag: " + rawTag); // We still process the rest, so we report all invalid tags in the input in a single run. }