4 ['@semantic-release/commit-analyzer', {
6 releaseRules: './release-rules.js',
8 '@semantic-release/release-notes-generator',
9 ['@semantic-release/changelog', {
10 changelogFile: 'CHANGELOG.md',
11 changelogTitle: '# Changelog',
13 ['@semantic-release/exec', {
14 prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
16 ['@semantic-release/git', {
17 assets: ['*.md', 'docs/*.rst', 'FORMULA'],
19 '@semantic-release/github',
24 // Required due to upstream bug preventing all types being displayed.
25 // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
26 // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
27 transform: (commit, context) => {
30 commit.notes.forEach(note => {
31 note.title = `BREAKING CHANGES`
34 // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
35 if (commit.type === `feat`) {
36 commit.type = `Features`
37 } else if (commit.type === `fix`) {
38 commit.type = `Bug Fixes`
39 } else if (commit.type === `perf`) {
40 commit.type = `Performance Improvements`
41 } else if (commit.type === `revert`) {
42 commit.type = `Reverts`
43 } else if (commit.type === `docs`) {
44 commit.type = `Documentation`
45 } else if (commit.type === `style`) {
46 commit.type = `Styles`
47 } else if (commit.type === `refactor`) {
48 commit.type = `Code Refactoring`
49 } else if (commit.type === `test`) {
51 } else if (commit.type === `build`) {
52 commit.type = `Build System`
53 // } else if (commit.type === `chore`) {
54 // commit.type = `Maintenance`
55 } else if (commit.type === `ci`) {
56 commit.type = `Continuous Integration`
61 if (commit.scope === `*`) {
65 if (typeof commit.hash === `string`) {
66 commit.shortHash = commit.hash.substring(0, 7)
69 if (typeof commit.subject === `string`) {
70 let url = context.repository
71 ? `${context.host}/${context.owner}/${context.repository}`
74 url = `${url}/issues/`
76 commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
78 return `[#${issue}](${url}${issue})`
83 commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
84 if (username.includes('/')) {
88 return `[@${username}](${context.host}/${username})`
93 // remove references that already appear in the subject
94 commit.references = commit.references.filter(reference => {
95 if (issues.indexOf(reference.issue) === -1) {