Github : Changelog.md bash script

Github : Changelog.md bash script

Recently I have been tagging my releases with the following tag format "release/0.2.10" and I felt the need to generate a changelog that would then be visible on github and in case I needed to recount the changes that were done per release.ermissions

First thing I did was to check if there was something out there already and I found some packages but they did not suite my needs. So I found this small script on stackoverflow by Andrey Nikishaev to loop through tags in a github repository and ouput the result in the terminal.

I had to modify the code a bit to include the commit date of the release and because I am using a different tag format for releases, rather than just a version number. Although the code is not perfect you can filter by author in the git log line e.g. 'SImon Facciol\|John Doe\|mary.doe'.

To generate the changelog.md file, create a file with that name and extension in the local repository root and copy the bash script in the same folder. Then open a terminal or console window, navigate to the repository root and run chmod +x script.sh so the script has execute permissions. Then run ./script.sh > changelog.md and if all goes well you should be able to see the tags and commit messages inside changelog.md file.

To update the changelog simply run the script, and it will overwrite the existing changelog.md.