Skip to content

Commit eb289dd

Browse files
committed
✨ Add Release type headers to template
1 parent 5cc92eb commit eb289dd

File tree

7 files changed

+569
-6
lines changed

7 files changed

+569
-6
lines changed

.release/.releaserc.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const templateDir = "./"
1010
const template = readFileAsync(path.join(templateDir, 'release-template.hbs'))
1111
const commitTemplate = readFileAsync(path.join(templateDir, 'commit-template.hbs'))
1212
const semverObj = JSON.parse(fs.readFileSync('./semver.json', 'utf8'));
13+
const gitmojisObj = JSON.parse(fs.readFileSync('./gitmojis.json', 'utf8'));
1314

1415
const releaseRules = {
1516
major: convert(semverObj.semver.major),
@@ -58,6 +59,38 @@ const releaseNotes = {
5859
return ""
5960
}
6061
},
62+
majorHeader: function (commits) {
63+
for (const gitmojiObj of gitmojisObj.gitmojis) {
64+
if(gitmojiObj.emoji in commits && gitmojiObj.semver==='major'){
65+
return "## Breaking Changes"
66+
}
67+
}
68+
return ""
69+
},
70+
minorHeader: function (commits) {
71+
for (const gitmojiObj of gitmojisObj.gitmojis) {
72+
if(gitmojiObj.emoji in commits && gitmojiObj.semver==='minor'){
73+
return "## New Features"
74+
}
75+
}
76+
return ""
77+
},
78+
patchHeader: function (commits) {
79+
for (const gitmojiObj of gitmojisObj.gitmojis) {
80+
if(gitmojiObj.emoji in commits && gitmojiObj.semver==='patch'){
81+
return "## Fixes"
82+
}
83+
}
84+
return ""
85+
},
86+
noneHeader: function (commits) {
87+
for (const gitmojiObj of gitmojisObj.gitmojis) {
88+
if(gitmojiObj.emoji in commits && gitmojiObj.semver==='none'){
89+
return "## Miscellaneous"
90+
}
91+
}
92+
return ""
93+
},
6194
},
6295
issueResolution: {
6396
template: '{baseUrl}/{owner}/{repo}/issues/{ref}',

.release/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# .release
22

3+
Generated by https://github.com/nkmr-jp/gitmoji-semver
4+
35
Check Next Release
46

57
```sh

0 commit comments

Comments
 (0)