A tiny wrapper for commit-analyzer and release-notes-generator which works with squashed MRs
npm install semantic-release-unsquashA tiny wrapper for commit-analyzer and release-notes-generator which works with squashed MRs

``bash`
$ npm install -D semantic-release-unsquash
The plugin does not have its own configuration, but it passes configuration to wrapped plugins
``json`
{
"plugins": [
["semantic-release-unsquash", {
"commitAnalyzerConfig": {
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
}
},
"notesGeneratorConfig": {
"preset": "angular",
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
}]
]
}
To deactivate the generation of release notes, e.g. if you use your own / another plugin to generate them, you can do this with:
`json`
{
"plugins": [
[
"semantic-release-unsquash",
{
"commitAnalyzerConfig": { },
"notesGeneratorConfig": false
}
]
]
}
GitHub automatically adds a list of squashed commit messages to the squash commit message.
To use this plugin with GitLab, you need to go to your project settings and in the Merge Requests section update the Squash commit message template field to the following:
`ruby
%{title}
%{all_commits}
`
You can pass getUnsquashedCommitsConfig to fine‑tune how the plugin finds
and expands squashed commits inside the merge commit body:
`json`
{
"plugins": [
[
"semantic-release-unsquash",
{
"getUnsquashedCommitsConfig": {
"sectionHeading": "### Changes",
"sectionRegexStr": "### Changes(?:\\n|\\r\\n){2}([\\s\\S]*?)(?=$)",
"listItemPrefixes": ["* ", "- "],
"listItemRegexStr": "^\\s\\"
}
}
]
]
}
- sectionHeading: literal string to locate the start of the commit list.sectionRegexStr
Everything after the heading (trimmed) is parsed.
- : alternative regex selector. If it contains a capturelistItemPrefixes
group, that content is used; otherwise the matched substring is parsed.
- / listItemPrefix: configure bullet prefixes if you use*
something other than the default (). For example, specify ["- "] iflistItemRegexStr
your squashed commit list uses dash bullets.
- : full custom matcher for bullets (takes priority over*feat: ...`.
prefixes), useful for compact formats such as
These options can be combined. Multi-line commit bodies remain attached to the
bullet that introduced them.