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
14
.github/scripts/pr-title.ts
vendored
14
.github/scripts/pr-title.ts
vendored
@ -34,17 +34,17 @@ async function run() {
|
|||||||
|
|
||||||
|
|
||||||
const info = `
|
const info = `
|
||||||
Terminology: fix(ui): Fix female trainer names
|
Terminology: [bug(ui)]: Fix female trainer names
|
||||||
^ ^ ^
|
^ ^ ^
|
||||||
| | |__ Subject
|
| | |__ Subject
|
||||||
| |_______ Scope
|
| |________ Scope
|
||||||
|___________ Prefix
|
|____________ Prefix
|
||||||
`;
|
`;
|
||||||
|
|
||||||
core.info(info.trim());
|
core.info(info.trim());
|
||||||
|
|
||||||
// Check if title pass regex
|
// 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)) {
|
if (!regex.test(title)) {
|
||||||
core.setFailed(`Pull Request title "${title}" failed to match - 'Prefix(Scope): Subject'`);
|
core.setFailed(`Pull Request title "${title}" failed to match - 'Prefix(Scope): Subject'`);
|
||||||
return;
|
return;
|
||||||
@ -52,7 +52,7 @@ Terminology: fix(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.startsWith(prefix))) {
|
if (!PREFIXES.some((prefix) => title.toLowerCase().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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user