mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 12:49:14 +00:00
Strip the scope in parentheses so titles like 'refactor(host): ...' resolve to the 'refactor' type instead of falling back to 'other'. (cherry picked from commit 87baf753016132c4fcf8e1166fa9c085de78a206) Signed-off-by: Andy Lee <andy.lee@suse.com> Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
e991c9bcc8
commit
bcde1744e1
@ -7,7 +7,11 @@ if (process.argv.length < 3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const prTitle = process.argv[2];
|
const prTitle = process.argv[2];
|
||||||
const prLabel = prTitle.split(':')[0].trim();
|
|
||||||
|
// Parse the conventional-commit prefix `type(scope)!:`, keeping only the type
|
||||||
|
// and dropping an optional scope and breaking-change marker.
|
||||||
|
const prefixMatch = prTitle.match(/^\s*([a-zA-Z]+)(?:\([^)]*\))?!?:/);
|
||||||
|
const prLabel = prefixMatch ? prefixMatch[1].toLowerCase() : '';
|
||||||
|
|
||||||
const config = await load({ extends: ["./commitlint.config.js"] });
|
const config = await load({ extends: ["./commitlint.config.js"] });
|
||||||
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];
|
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user