From 70af81cd738b59385cbd3caffa0e106c92150677 Mon Sep 17 00:00:00 2001 From: George Choustoulakis Date: Wed, 21 Feb 2024 13:08:17 +0100 Subject: [PATCH] Remove empty changelog sections --- .changeset/post-process.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.changeset/post-process.js b/.changeset/post-process.js index 122025cb..b512a3e5 100644 --- a/.changeset/post-process.js +++ b/.changeset/post-process.js @@ -8,6 +8,8 @@ for (const workspace of require('../package.json').workspaces) { changelog = changelog .replace(/^### Major Changes/gm, '### 💥 Breaking Changes') .replace(/^### Minor Changes/gm, '### ✨ Features') - .replace(/^### Patch Changes/gm, '### 🐛 Issues'); + .replace(/^### Patch Changes/gm, '### 🐛 Issues') + // Remove empty sections + .replace(/\n### ([^\n]+)\n\n###/g, '\n###'); fs.writeFileSync(changelogPath, changelog); }