Skip to content

Commit

Permalink
feat(ci): add commit body in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbrozer committed Sep 10, 2023
1 parent 64d5d1e commit 98a9cba
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .release-it.json → .release-it.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
const fs = require('fs');

const commitTemplate = fs.readFileSync('.release-it/commit.hbs').toString();

module.exports = {
"hooks": {
"after:git:release": "make VERSION=${version} dist"
},
Expand All @@ -17,7 +21,10 @@
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md",
"header": "# Changelog"
"header": "# Changelog",
"writerOpts": {
"commitPartial": commitTemplate
}
},
"@j-ulrich/release-it-regex-bumper": {
"out": [
Expand Down
57 changes: 57 additions & 0 deletions .release-it/commit.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
* {{header}}

{{~!-- commit link --}}
{{~#if @root.linkReferences}} ([{{hash}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.commit}}/{{hash}}))
{{~else if hash}} {{hash}}{{~/if}}

{{~!-- commit references --}}
{{~#if references~}}
, closes
{{~#each references}} {{#if @root.linkReferences~}}
[
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}#{{this.issue}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if this.repository}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}
{{~else}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~/if}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.issue}}/{{this.issue}})
{{~else}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}#{{this.issue}}
{{~/if}}{{/each}}
{{~/if}}
\n
{{#if body}}
{{body}}
{{/if}}

0 comments on commit 98a9cba

Please sign in to comment.