ci: allow PR title to have parentheses

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2026-03-24 14:36:05 +08:00
parent f3c442f0ea
commit 25f9d0c6f1
No known key found for this signature in database
GPG Key ID: 39DC4436AE3564D5

View File

@ -7,7 +7,9 @@ if (process.argv.length < 3) {
}
const prTitle = process.argv[2];
const prLabel = prTitle.split(':')[0].trim();
const match = prTitle.match(/^(\w+)(\(.+\))?:/);
const prLabel = match ? match[1].trim() : prTitle.split(':')[0].trim();
console.log('PR Label:', prLabel);
const config = await load({ extends: ["./commitlint.config.js"] });
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];