feature: add script for release notes
This commit is contained in:
parent
ac62e47083
commit
783bfb47dc
2 changed files with 41 additions and 0 deletions
24
resources/scripts/release-notes.bash
Normal file
24
resources/scripts/release-notes.bash
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get tags sorted by creation date
|
||||
tags=$(git tag --sort=creatordate)
|
||||
|
||||
# Convert tags into an array using IFS
|
||||
IFS=$'\n' tagArray=("$tags")
|
||||
|
||||
# Get the number of tags
|
||||
len=${#tagArray[@]}
|
||||
|
||||
# Extract the last and second last tags based on length
|
||||
latestTag=${tagArray[$len-1]}
|
||||
secondLastTag=${tagArray[$len-2]}
|
||||
|
||||
# Check if the tags are assigned correctly
|
||||
if [ -z "$latestTag" ] || [ -z "$secondLastTag" ]; then
|
||||
echo "Not enough tags found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate release notes from commits between the two latest tags
|
||||
echo "Release Notes from $secondLastTag to $latestTag:"
|
||||
git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep -E 'feature:|fix:' | sort | uniq | sed -e 's/feature:/\nNew Feature:/g' -e 's/fix:/\nFix:/g'
|
||||
Loading…
Add table
Add a link
Reference in a new issue