Skip to content

Commit

Permalink
ci: fix changelog template and release labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Oct 8, 2021
1 parent 6456a39 commit a80c538
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .releaserc/commit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@
{{~/if}}
{{~this.repository}}#{{this.issue}}
{{~/if}}{{/each}}
{{~/if}}
{{~/if}}

4 changes: 2 additions & 2 deletions .releaserc/footer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
### {{title}}

{{#each notes}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} ([{{commit.shortHash}}]({{commit.shortHash}}))
{{/each}}
{{/each}}

{{/if}}
{{/if}}
2 changes: 1 addition & 1 deletion .releaserc/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
{{~#if title}} "{{title}}"
{{~/if}}
{{~#if date}} ({{date}})
{{/if}}
{{/if}}
8 changes: 7 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const path = require('path');

// Get env vars
const ref = process.env.GITHUB_REF;
const serverUrl = process.env.GITHUB_SERVER_URL;
const repository = process.env.GITHUB_REPOSITORY;
const repositoryUrl = serverUrl + '/' + repository;

// Declare params
const resourcePath = './.releaserc/';
Expand Down Expand Up @@ -84,6 +87,8 @@ async function config() {
}],
["@semantic-release/github", {
successComment: getReleaseComment(),
labels: ['type:ci'],
releasedLabels: ['state:released<%= nextRelease.channel ? `-\${nextRelease.channel}` : "" %>']
}],
],
};
Expand All @@ -103,7 +108,8 @@ async function readFile(filePath) {
}

function getReleaseComment() {
const comment = '🎉 This issue has been resolved in version [${nextRelease.version}](<github_release_url>)';
const url = repositoryUrl + '/releases/tag/${nextRelease.gitTag}';
const comment = '🎉 This pull request has been released in version [${nextRelease.version}](' + url + ')';
return comment;
}

Expand Down

0 comments on commit a80c538

Please sign in to comment.