(commit)
| 78 | } |
| 79 | |
| 80 | function getCommitBump(commit) { |
| 81 | const headerMatch = commit.subject.match(/^([a-z]+)(\([^)]*\))?(!)?:\s+/i) |
| 82 | const type = headerMatch?.[1]?.toLowerCase() |
| 83 | const breaking = Boolean(headerMatch?.[3]) || /BREAKING CHANGE:/i.test(commit.body) |
| 84 | |
| 85 | if (breaking) return 'major' |
| 86 | if (type === 'feat') return 'minor' |
| 87 | if (type && PATCH_TYPES.has(type)) return 'patch' |
| 88 | return null |
| 89 | } |
| 90 | |
| 91 | function mergeBump(current, incoming) { |
| 92 | const rank = { patch: 1, minor: 2, major: 3 } |