From 269bdb0e98cdbbdfbb1c15c3be95b32ed6e5d0ad Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Sun, 9 Jun 2024 21:59:30 -0400 Subject: [PATCH] update pr title spec to match current style --- .github/scripts/pr-title.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/scripts/pr-title.ts b/.github/scripts/pr-title.ts index 1c8efb94972..af1de839f85 100644 --- a/.github/scripts/pr-title.ts +++ b/.github/scripts/pr-title.ts @@ -34,17 +34,17 @@ async function run() { const info = ` -Terminology: fix(ui): Fix female trainer names - ^ ^ ^ - | | |__ Subject - | |_______ Scope - |___________ Prefix +Terminology: [bug(ui)]: Fix female trainer names + ^ ^ ^ + | | |__ Subject + | |________ Scope + |____________ Prefix `; core.info(info.trim()); // Check if title pass regex - const regex = RegExp(/^[a-zA-Z]+(\([a-zA-Z]+\))?: .+/); + const regex = RegExp(/^\[[a-zA-Z]+(\([a-zA-Z]+\))?\]: .+/); if (!regex.test(title)) { core.setFailed(`Pull Request title "${title}" failed to match - 'Prefix(Scope): Subject'`); return; @@ -52,7 +52,7 @@ Terminology: fix(ui): Fix female trainer names // Check if title starts with an allowed prefix core.info(`Allowed prefixes: ${PREFIXES}`); - if (!PREFIXES.some((prefix) => title.startsWith(prefix))) { + if (!PREFIXES.some((prefix) => title.toLowerCase().startsWith(prefix))) { core.setFailed(`Pull Request title "${title}" did not match any of the prefixes - ${PREFIXES}`); return; }