From 6698b7384db6ee861b86a9d3307ad6a407f765df Mon Sep 17 00:00:00 2001 From: dkoo Date: Tue, 25 Jun 2024 10:36:11 -0600 Subject: [PATCH] fix: successComment value in @semantic-release/github config --- scripts/release.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/release.js b/scripts/release.js index caf519b..9713540 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -22,6 +22,20 @@ if (shouldPublishOnNPM) { const getConfig = ({ gitBranchName }) => { const branchType = gitBranchName.split("/")[0]; + const githubConfig = { + assets: [ + { + path: `./release/${process.env.CIRCLE_PROJECT_REPONAME}.zip`, + label: `${process.env.CIRCLE_PROJECT_REPONAME}.zip`, + }, + ], + }; + + // Only post GH PR comments for alpha, hotfix/*, and release branches. + if ( ! ["alpha", "hotfix", "release"].includes(branchType) ) { + githubConfig.successComment = false; + githubConfig.failComment = false; + } const config = { dryRun: otherArgs.dryRun, @@ -66,16 +80,7 @@ const getConfig = ({ gitBranchName }) => { // Add the built ZIP archive to GH release. [ "@semantic-release/github", - { - assets: [ - { - path: `./release/${process.env.CIRCLE_PROJECT_REPONAME}.zip`, - label: `${process.env.CIRCLE_PROJECT_REPONAME}.zip`, - }, - ], - // Only post GH PR comments for alpha, hotfix/*, and release branches. - successComment: ["alpha", "hotfix", "release"].includes(branchType), - }, + githubConfig, ], ], };