Creating release notes based on git commit history

by GarciaPL on Sunday 18 February 2018

If your JIRA does not support generating release notes because of for instance you do not fulfil Version field like in my case, there is a way to generate it based on git commit history.

First of all, you need to install a package called git-release-notes [2] via npm. It will allow you to generate release note page from git commit history using the following command :

git-release-notes 2.2.2..HEAD markdown.ejs > changelog.md

Of course, 2.2.2 is a git tag.

You might also use mentioned above template called markdown.ejs which has been written in EJS [3]. In my opinion, this template gives more control in terms how release notes will look like at the end. Of course, you might also depend on built-in template into git-release-notes module.

<% commits.forEach(function (commit) { %>
    <% if(!commit.title.startsWith('[maven-release-plugin]')) { %>
        <%= 'http://jira.com/browse/' + commit.title -%>
    <% } %>
<% }) %>


References :
[1] Confluence.atlassian.com - Creating release notes
[2] NPM - git-release-notes
[3] Ejs.co