fix(release): normalize appended PR suffixes (#120971)

This commit is contained in:
Vincent Koc
2026-08-09 23:21:32 +08:00
committed by GitHub
parent 9a96375e60
commit 41423753e0
2 changed files with 12 additions and 6 deletions
@@ -684,7 +684,7 @@ export function contributionRecordTarget(section) {
}
export function pullRequestTitleFromCommitSubject(subject, number) {
const match = subject.match(/^(?<title>\S(?:.*?\S)?)(?<pr> \(#(?<number>[1-9]\d*)\))\k<pr>*$/u);
const match = subject.match(/^(?<title>\S(?:.*\S)?)(?<! \(#\d+\)) \(#(?<number>[1-9]\d*)\)$/u);
return match?.groups?.number === String(number) ? match.groups.title : undefined;
}
@@ -839,7 +839,7 @@ function appendReferences(references, additions) {
function normalizedCommitSubject(subject) {
return subject
.replace(/\s+\(#\d+\)\s*$/, "")
.replace(/(?:\s+\(#\d+\))+\s*$/, "")
.replace(/\s+/g, " ")
.trim()
.toLowerCase();