@@ -10,6 +10,7 @@ const templateDir = "./"
1010const template = readFileAsync ( path . join ( templateDir , 'release-template.hbs' ) )
1111const commitTemplate = readFileAsync ( path . join ( templateDir , 'commit-template.hbs' ) )
1212const semverObj = JSON . parse ( fs . readFileSync ( './semver.json' , 'utf8' ) ) ;
13+ const gitmojisObj = JSON . parse ( fs . readFileSync ( './gitmojis.json' , 'utf8' ) ) ;
1314
1415const 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}' ,
0 commit comments