-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge commits not appearing in the changelog commits list #254
Comments
I'm not using the standard handlebars template, so I guess it's something to do with that. There is no {{#if merges}} section, I guess it could be to do with that.
|
OK merges are now being included in the changelog after adding the section for the keepchangelog.hbs template in this repo.
There are in a separate section and not listed along the regular 'Features' and 'Fixes' commit-list though. |
OK so after running:
It's clear that merges and commits are separate objects and the merge.commit is not part of the commits list. This is a pain when using Trunk based development and squash merges, as generally there will be no direct commits on master and only merge commits. So, I'd like to have the commit-list helper process the merge commits too. Hence it would be good if auto-changelog had an option such as In the meantime, seems I'll just have to accept having a simple Merges list without any of the logic to categorize merge commits like with the commit-list helper. |
Thanks for this useful template! And it is very nice! |
I use my approach Handlebars.registerHelper('commit-parser', function (merges, commits, options) {
const commitsFromMerges = merges.map((merge) => merge.commit);
const result = commits.concat(commitsFromMerges);
return options.fn(result);
}); # Changelog
All notable changes to this project will be documented in this file. See
[standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
{{#each releases}}
{{#if tag}}
##{{#unless major}}#{{/unless}} [{{#replaceTitle}}{{title}}{{/replaceTitle}}]({{href}}) ({{isoDate}})
{{/if}}
{{#if summary}}
{{summary}}
{{/if}}
{{#commit-parser merges commits}}
{{#commit-list this heading='### ⚠ BREAKING CHANGES' message='[bB]reaking [cC]hange:|[bB]reaking:' }}
- {{#replaceCommit}}{{subject}}{{/replaceCommit}} [({{shorthash}})]({{href}})
{{/commit-list}}
{{#commit-list this heading='### 🚀 Features' message='^[fF]eat:|[fF]eat\(|^[rR]efactor:|^[rR]efactor\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:'}}
- {{#replaceCommit}}{{subject}}{{/replaceCommit}} [({{shorthash}})]({{href}})
{{/commit-list}}
{{#commit-list this heading='### 🐞 Bug Fixes' message='^[fF]ix:|^[fF]ix\(|^[pP]erf:|^[pP]erf\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:'}}
- {{#replaceCommit}}{{subject}}{{/replaceCommit}} [({{shorthash}})]({{href}})
{{/commit-list}}
{{/commit-parser}}
{{/each}} |
same here |
When I create a pull request and perform a Squash and Merge, the merge commit for the PR is not showing up in the changelog after running auto-changelog.
I've been trying to troubleshoot why that is but can't find any reason for it. The PR commit message matches the regular commit pattern that is working. Only regular commits on master are being added to the changelog.
I assume there's something unique about the PR merge commit that means it gets ignored. GitHub appends a PR number at the end of the commit message and adds some additional 'co-author' details.
Anyone else experienced this issue and know how to fix it?
The text was updated successfully, but these errors were encountered: