3 repositoryUrl: 'https://github.com/saltstack-formulas/arvados-formula',
5 ['@semantic-release/commit-analyzer', {
7 releaseRules: './release-rules.js',
9 '@semantic-release/release-notes-generator',
10 ['@semantic-release/changelog', {
11 changelogFile: 'CHANGELOG.md',
12 changelogTitle: '# Changelog',
14 ['@semantic-release/exec', {
15 prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
17 ['@semantic-release/git', {
18 assets: ['*.md', 'docs/*.rst', 'FORMULA'],
20 '@semantic-release/github',
25 // Required due to upstream bug preventing all types being displayed.
26 // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
27 // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
28 transform: (commit, context) => {
31 commit.notes.forEach(note => {
32 note.title = `BREAKING CHANGES`
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`) {
52 } else if (commit.type === `build`) {
53 commit.type = `Build System`
54 // } else if (commit.type === `chore`) {
55 // commit.type = `Maintenance`
56 } else if (commit.type === `ci`) {
57 commit.type = `Continuous Integration`
62 if (commit.scope === `*`) {
66 if (typeof commit.hash === `string`) {
67 commit.shortHash = commit.hash.substring(0, 7)
70 if (typeof commit.subject === `string`) {
71 let url = context.repository
72 ? `${context.host}/${context.owner}/${context.repository}`
75 url = `${url}/issues/`
77 commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
79 return `[#${issue}](${url}${issue})`
84 commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
85 if (username.includes('/')) {
89 return `[@${username}](${context.host}/${username})`
94 // remove references that already appear in the subject
95 commit.references = commit.references.filter(reference => {
96 if (issues.indexOf(reference.issue) === -1) {