From 28fe95b3d941ab1e2b948cba5e6be199986d142e Mon Sep 17 00:00:00 2001 From: Gaby Zifferman Date: Tue, 29 Oct 2024 15:41:06 +0100 Subject: [PATCH] chore: (config) add conditional changelog generation for main branch only --- release.config.cjs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/release.config.cjs b/release.config.cjs index 901cda33..6bb64dd9 100644 --- a/release.config.cjs +++ b/release.config.cjs @@ -1,3 +1,5 @@ +const isMainBranch = process.env.GITHUB_REF === 'refs/heads/main'; + module.exports = { branches: [ 'main', @@ -44,13 +46,14 @@ module.exports = { preset: 'angular', }, ], - [ - '@semantic-release/changelog', - { - changelogFile: 'CHANGELOG.md', - branches: ['main'] - }, - ], + ...(isMainBranch ? [ + [ + '@semantic-release/changelog', + { + changelogFile: 'CHANGELOG.md', + }, + ], + ] : []), ['@semantic-release/npm'], [ '@semantic-release/github',