fix lowercase logic

This commit is contained in:
Dmitriy 2024-06-09 22:04:25 -04:00
parent 269bdb0e98
commit 86a212fc1a

View File

@ -28,7 +28,7 @@ async function run() {
pull_number: github.context.payload.pull_request!.number, pull_number: github.context.payload.pull_request!.number,
}); });
const title = pullRequest.title; const title: string = pullRequest.title.toLowerCase();
core.info(`Pull Request title: "${title}"`); core.info(`Pull Request title: "${title}"`);
@ -52,7 +52,7 @@ Terminology: [bug(ui)]: Fix female trainer names
// Check if title starts with an allowed prefix // Check if title starts with an allowed prefix
core.info(`Allowed prefixes: ${PREFIXES}`); core.info(`Allowed prefixes: ${PREFIXES}`);
if (!PREFIXES.some((prefix) => title.toLowerCase().startsWith(prefix))) { if (!PREFIXES.some((prefix) => title.startsWith(prefix))) {
core.setFailed(`Pull Request title "${title}" did not match any of the prefixes - ${PREFIXES}`); core.setFailed(`Pull Request title "${title}" did not match any of the prefixes - ${PREFIXES}`);
return; return;
} }