Skip to content

Commit

Permalink
fix: successComment value in @semantic-release/github config (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Jun 25, 2024
1 parent f903611 commit dba9d23
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
],
],
};
Expand Down

0 comments on commit dba9d23

Please sign in to comment.