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(