Skip to content

Commit f933c43

Browse files
mfranzkeCopilotmichaelmkraus
authored
refactor: changelog entry sorting (#5318)
* refactor: changelog entry sorting * Update scripts/github/changesets/publish.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update publish.ts * Fix comment formatting in publish.ts * Update scripts/github/changesets/publish.ts Co-authored-by: Michael Kraus <michael.m.kraus@deutschebahn.com> * Update scripts/github/changesets/publish.ts * refactor: prettier --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Michael Kraus <michael.m.kraus@deutschebahn.com>
1 parent 72ad7a0 commit f933c43

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/github/changesets/publish.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ function getReleaseNotes(): string {
5454
if (section) {
5555
const headline =
5656
getFirstHeadline(changelog) || path.relative(repoRoot, file);
57-
notes.push(`# ${headline}\n${section}`);
57+
const entry = `# ${headline}\n${section}`;
58+
// Ensure a logical sequence, packages with Release notes first, packages that are only getting version bumped last
59+
const isVersionBump = /^\s*[-*+]?\s*_version bump_\s*$/m.test(
60+
section
61+
);
62+
if (isVersionBump) {
63+
notes.push(entry);
64+
} else {
65+
notes.unshift(entry);
66+
}
5867
}
5968
}
6069

0 commit comments

Comments
 (0)