fix(github): recognize full-width PR title colons
This commit is contained in:
parent
a71104be5f
commit
da53d207db
|
|
@ -99,7 +99,7 @@ function normalizeChangedFiles(changedFiles) {
|
|||
|
||||
function conventionalType(title) {
|
||||
const normalized = String(title || "").trim().replace(/^[^\p{L}\p{N}]+/u, "");
|
||||
return /^([a-z]+)(?:\([^)]*\))?!?:/i.exec(normalized)?.[1]?.toLowerCase() || null;
|
||||
return /^([a-z]+)(?:\([^)]*\))?!?[::]/i.exec(normalized)?.[1]?.toLowerCase() || null;
|
||||
}
|
||||
|
||||
export function isDocumentationFile(file) {
|
||||
|
|
|
|||
|
|
@ -88,6 +88,16 @@ test("does not treat component tests or MCP server code as UI or deploy changes"
|
|||
assert.deepEqual(result.labels, ["area/desktop", "area/mcp", "bug"]);
|
||||
});
|
||||
|
||||
test("recognizes conventional titles with a full-width colon", () => {
|
||||
const result = evaluatePullRequestLabels({
|
||||
title: "Fix:补全 GaussDB M 模式 SQL 生成",
|
||||
changedFiles: ["crates/dbx-core/src/db/mod.rs"],
|
||||
knownDatabaseTypes,
|
||||
});
|
||||
|
||||
assert.deepEqual(result.labels, ["area/core", "bug"]);
|
||||
});
|
||||
|
||||
test("detects only newly added package dependencies", () => {
|
||||
const result = inferAddedDependencies(
|
||||
["package.json"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue