mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 23:32:19 +02:00
update pr title spec to match current style
This commit is contained in:
parent
2a3535c6aa
commit
269bdb0e98
10
.github/scripts/pr-title.ts
vendored
10
.github/scripts/pr-title.ts
vendored
@ -34,17 +34,17 @@ async function run() {
|
||||
|
||||
|
||||
const info = `
|
||||
Terminology: fix(ui): Fix female trainer names
|
||||
Terminology: [bug(ui)]: Fix female trainer names
|
||||
^ ^ ^
|
||||
| | |__ Subject
|
||||
| |_______ Scope
|
||||
|___________ Prefix
|
||||
| |________ 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user