diff --git a/scripts/extract-release-label.mjs b/scripts/extract-release-label.mjs index 93d13be0..8e8ef7bf 100644 --- a/scripts/extract-release-label.mjs +++ b/scripts/extract-release-label.mjs @@ -7,7 +7,11 @@ if (process.argv.length < 3) { } 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 commitPrefix = config?.rules?.['type-enum']?.[2] || [];