@@ -2,22 +2,23 @@ module.exports = {
22 branch : 'master' ,
33 repositoryUrl : 'https://github.com/saltstack-formulas/vault-formula' ,
44 plugins : [
5- [ '@semantic-release/commit-analyzer' , {
6- preset : 'angular' ,
7- releaseRules : './release-rules.js' ,
8- } ] ,
9- '@semantic-release/release-notes-generator' ,
10- [ '@semantic-release/changelog' , {
11- changelogFile : 'CHANGELOG.md' ,
12- changelogTitle : '# Changelog' ,
13- } ] ,
14- [ '@semantic-release/exec' , {
15- prepareCmd : 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}' ,
16- } ] ,
17- [ '@semantic-release/git' , {
18- assets : [ '*.md' , 'docs/*.rst' , 'FORMULA' ] ,
19- } ] ,
20- '@semantic-release/github' ,
5+ [ '@semantic-release/commit-analyzer' , {
6+ preset : 'angular' ,
7+ releaseRules : './release-rules.js'
8+ } ] ,
9+ '@semantic-release/release-notes-generator' ,
10+ [ '@semantic-release/changelog' , {
11+ changelogFile : 'CHANGELOG.md' ,
12+ changelogTitle : '# Changelog'
13+ } ] ,
14+ [ '@semantic-release/exec' , {
15+ // eslint-disable-next-line no-template-curly-in-string
16+ prepareCmd : 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}'
17+ } ] ,
18+ [ '@semantic-release/git' , {
19+ assets : [ '*.md' , 'docs/*.rst' , 'FORMULA' ]
20+ } ] ,
21+ '@semantic-release/github'
2122 ] ,
2223 generateNotes : {
2324 preset : 'angular' ,
@@ -26,82 +27,82 @@ module.exports = {
2627 // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
2728 // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
2829 transform : ( commit , context ) => {
29- const issues = [ ]
30+ const issues = [ ]
3031
31- commit . notes . forEach ( note => {
32- note . title = ` BREAKING CHANGES`
33- } )
32+ commit . notes . forEach ( note => {
33+ note . title = ' BREAKING CHANGES'
34+ } )
3435
35- // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
36- if ( commit . type === ` feat` ) {
37- commit . type = ` Features`
38- } else if ( commit . type === ` fix` ) {
39- commit . type = ` Bug Fixes`
40- } else if ( commit . type === ` perf` ) {
41- commit . type = ` Performance Improvements`
42- } else if ( commit . type === ` revert` ) {
43- commit . type = ` Reverts`
44- } else if ( commit . type === ` docs` ) {
45- commit . type = ` Documentation`
46- } else if ( commit . type === ` style` ) {
47- commit . type = ` Styles`
48- } else if ( commit . type === ` refactor` ) {
49- commit . type = ` Code Refactoring`
50- } else if ( commit . type === ` test` ) {
51- commit . type = ` Tests`
52- } else if ( commit . type === ` build` ) {
53- commit . type = ` Build System`
36+ // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
37+ if ( commit . type === ' feat' ) {
38+ commit . type = ' Features'
39+ } else if ( commit . type === ' fix' ) {
40+ commit . type = ' Bug Fixes'
41+ } else if ( commit . type === ' perf' ) {
42+ commit . type = ' Performance Improvements'
43+ } else if ( commit . type === ' revert' ) {
44+ commit . type = ' Reverts'
45+ } else if ( commit . type === ' docs' ) {
46+ commit . type = ' Documentation'
47+ } else if ( commit . type === ' style' ) {
48+ commit . type = ' Styles'
49+ } else if ( commit . type === ' refactor' ) {
50+ commit . type = ' Code Refactoring'
51+ } else if ( commit . type === ' test' ) {
52+ commit . type = ' Tests'
53+ } else if ( commit . type === ' build' ) {
54+ commit . type = ' Build System'
5455 // } else if (commit.type === `chore`) {
5556 // commit.type = `Maintenance`
56- } else if ( commit . type === `ci` ) {
57- commit . type = ` Continuous Integration`
58- } else {
59- return
60- }
57+ } else if ( commit . type === 'ci' ) {
58+ commit . type = ' Continuous Integration'
59+ } else {
60+ return
61+ }
6162
62- if ( commit . scope === `*` ) {
63- commit . scope = ``
64- }
63+ if ( commit . scope === '*' ) {
64+ commit . scope = ''
65+ }
6566
66- if ( typeof commit . hash === ` string` ) {
67- commit . shortHash = commit . hash . substring ( 0 , 7 )
68- }
67+ if ( typeof commit . hash === ' string' ) {
68+ commit . shortHash = commit . hash . substring ( 0 , 7 )
69+ }
6970
70- if ( typeof commit . subject === `string` ) {
71- let url = context . repository
72- ? `${ context . host } /${ context . owner } /${ context . repository } `
73- : context . repoUrl
74- if ( url ) {
75- url = `${ url } /issues/`
76- // Issue URLs.
77- commit . subject = commit . subject . replace ( / # ( [ 0 - 9 ] + ) / g, ( _ , issue ) => {
78- issues . push ( issue )
79- return `[#${ issue } ](${ url } ${ issue } )`
80- } )
71+ if ( typeof commit . subject === 'string' ) {
72+ let url = context . repository
73+ ? `${ context . host } /${ context . owner } /${ context . repository } `
74+ : context . repoUrl
75+ if ( url ) {
76+ url = `${ url } /issues/`
77+ // Issue URLs.
78+ commit . subject = commit . subject . replace ( / # ( [ 0 - 9 ] + ) / g, ( _ , issue ) => {
79+ issues . push ( issue )
80+ return `[#${ issue } ](${ url } ${ issue } )`
81+ } )
82+ }
83+ if ( context . host ) {
84+ // User URLs.
85+ commit . subject = commit . subject . replace ( / \B @ ( [ a - z 0 - 9 ] (?: - ? [ a - z 0 - 9 / ] ) { 0 , 38 } ) / g, ( _ , username ) => {
86+ if ( username . includes ( '/' ) ) {
87+ return `@${ username } `
8188 }
82- if ( context . host ) {
83- // User URLs.
84- commit . subject = commit . subject . replace ( / \B @ ( [ a - z 0 - 9 ] (?: - ? [ a - z 0 - 9 / ] ) { 0 , 38 } ) / g, ( _ , username ) => {
85- if ( username . includes ( '/' ) ) {
86- return `@${ username } `
87- }
8889
89- return `[@${ username } ](${ context . host } /${ username } )`
90- } )
91- }
90+ return `[@${ username } ](${ context . host } /${ username } )`
91+ } )
9292 }
93+ }
9394
94- // remove references that already appear in the subject
95- commit . references = commit . references . filter ( reference => {
96- if ( issues . indexOf ( reference . issue ) === - 1 ) {
97- return true
98- }
95+ // remove references that already appear in the subject
96+ commit . references = commit . references . filter ( reference => {
97+ if ( issues . indexOf ( reference . issue ) === - 1 ) {
98+ return true
99+ }
99100
100- return false
101- } )
101+ return false
102+ } )
102103
103- return commit
104- } ,
105- } ,
106- } ,
107- } ;
104+ return commit
105+ }
106+ }
107+ }
108+ }
0 commit comments