Skip to content

Commit

Permalink
fix: support other conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
lekterable committed Apr 20, 2020
1 parent 4e02179 commit b2f5901
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const changelog = async version => {
const isReleaseNext = nextCommit && nextCommit.scope === 'release'

if (scope === 'release') return (changelog += `## ${message}\n\n`)
if (scope !== 'changelog') {
if (scope !== 'changelog' && scope !== 'CHANGELOG') {
return (changelog += `- ${title} ${hash.slice(0, 8)}\n${
isReleaseNext ? '\n' : ''
}`)
Expand Down
3 changes: 2 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export const getCommitDetails = commit => {
const {
groups: { hash, title }
} = commit.match(/(?<hash>.{40}) (?<title>.*)/)

const {
groups: { scope, message }
} = title.match(/(\w*)(?:\((?<scope>.*)\))?: (?<message>.*)/)
} = title.match(/(\w*)(?:\((?<scope>.*)\))?:? (?<message>.*)/)

return { hash, title, scope, message }
}

0 comments on commit b2f5901

Please sign in to comment.