Last active
March 30, 2023 12:49
-
-
Save Integralist/e27f16821806aa8037c442d805fc2e44 to your computer and use it in GitHub Desktop.
[Generate change log between two tags] #changelog #git
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 | |
tags=$(git for-each-ref --sort=-creatordate --format '%(refname) %(creatordate)' refs/tags | grep -Eo 'client/rust@v?[^ ]+') | |
latest_tag=$(echo "$tags" | head -n 1) | |
second_tag=$(echo "$tags" | head -n 2 | tail -1) | |
release_version=$(echo "$latest_tag" | cut -d @ -f 2) | |
# echo "all tags for this language: $tags" | |
# echo "latest tag: $latest_tag" | |
# echo "second tag: $second_tag" | |
changes=$(git log --pretty="- %s" "$latest_tag"..."$second_tag" --no-merges) | |
# echo "$changes" | |
# NOTE: xargs trims whitespace | |
printf "# \`v$release_version\`\n\n## CHANGES (commits: $(echo "$changes" | wc -l | xargs))\n\n$changes\n" > release_notes.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment