From 048088b412af2e78a08e8339daf3b9d981a8b2df Mon Sep 17 00:00:00 2001 From: Marika Marszalkowski Date: Thu, 12 Sep 2024 13:29:48 +0200 Subject: [PATCH] feg --- .github/actions/merge-changelogs/index.js | 5 ++++- build-packages/merge-changelogs/index.ts | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/actions/merge-changelogs/index.js b/.github/actions/merge-changelogs/index.js index 01623bcb64..70df4e2749 100644 --- a/.github/actions/merge-changelogs/index.js +++ b/.github/actions/merge-changelogs/index.js @@ -25,7 +25,10 @@ function getPackageName(changelog) { return changelog.split('\n')[0].split('/')[1]; } function splitByVersion(changelog) { - return changelog.split('\n## ').map(h2 => { + return changelog + .split('\n## ') + .slice(1) + .map(h2 => { const [version, ...content] = h2.split('\n'); return { version, diff --git a/build-packages/merge-changelogs/index.ts b/build-packages/merge-changelogs/index.ts index 4450be66cc..5db396759e 100644 --- a/build-packages/merge-changelogs/index.ts +++ b/build-packages/merge-changelogs/index.ts @@ -31,13 +31,16 @@ function getPackageName(changelog: string): string { } function splitByVersion(changelog: string): ContentByVersion[] { - return changelog.split('\n## ').map(h2 => { - const [version, ...content] = h2.split('\n'); - return { - version, - content: content.join('\n').trim() - }; - }); + return changelog + .split('\n## ') + .slice(1) + .map(h2 => { + const [version, ...content] = h2.split('\n'); + return { + version, + content: content.join('\n').trim() + }; + }); } function assertGroups(