Skip to content

Commit b3fb749

Browse files
ckerrcodebytere
authored andcommitted
chore: omit superceded Chromium updates from notes (electron#19400)
* feat: omit superceded Chromium updates from notes * chore: simplify changed code
1 parent 103b386 commit b3fb749

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

script/release/notes/notes.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ const getNotes = async (fromRef, toRef, newVersion) => {
591591
})
592592
}
593593

594+
pool.commits = removeSupercededChromiumUpdates(pool.commits)
595+
594596
const notes = {
595597
breaking: [],
596598
docs: [],
@@ -623,6 +625,20 @@ const getNotes = async (fromRef, toRef, newVersion) => {
623625
return notes
624626
}
625627

628+
const removeSupercededChromiumUpdates = (commits) => {
629+
const chromiumRegex = /^Updated Chromium to \d+\.\d+\.\d+\.\d+/
630+
const updates = commits.filter(commit => (commit.note || commit.subject).match(chromiumRegex))
631+
const keepers = commits.filter(commit => !updates.includes(commit))
632+
633+
// keep the newest update.
634+
if (updates.length) {
635+
updates.sort((a, b) => a.originalPr.number - b.originalPr.number)
636+
keepers.push(updates.pop())
637+
}
638+
639+
return keepers
640+
}
641+
626642
/***
627643
**** Render
628644
***/

0 commit comments

Comments
 (0)