Created
May 19, 2020 08:29
-
-
Save jsenin/f1ff46b4c7ec73caa840896228daa7f1 to your computer and use it in GitHub Desktop.
Update CHANGELOG adding all previous commits subject by default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_tag=production_$(date +'%Y%m%d') | |
git tag $current_tag | |
previous_tag=$(git tag -l 'prod*' --sort=-committerdate | grep -v $current_tag | head -n1) | |
commit_description=$(git log $previous_tag..$current_tag --pretty=format:" * %s") | |
if ! [ -f CHANGELOG.md ]; then touch CHANGELOG.md; fi; | |
cat << EOF > CHANGELOG.md | |
${current_tag} | |
=================== | |
${commit_description} | |
$(cat CHANGELOG.md) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment