@@ -10,6 +10,7 @@ const templateDir = "./"
10
10
const template = readFileAsync ( path . join ( templateDir , 'release-template.hbs' ) )
11
11
const commitTemplate = readFileAsync ( path . join ( templateDir , 'commit-template.hbs' ) )
12
12
const semverObj = JSON . parse ( fs . readFileSync ( './semver.json' , 'utf8' ) ) ;
13
+ const gitmojisObj = JSON . parse ( fs . readFileSync ( './gitmojis.json' , 'utf8' ) ) ;
13
14
14
15
const releaseRules = {
15
16
major : convert ( semverObj . semver . major ) ,
@@ -58,6 +59,38 @@ const releaseNotes = {
58
59
return ""
59
60
}
60
61
} ,
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
+ } ,
61
94
} ,
62
95
issueResolution : {
63
96
template : '{baseUrl}/{owner}/{repo}/issues/{ref}' ,
0 commit comments