Skip to content

Commit

Permalink
chore: add simple release notes script
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel committed Aug 20, 2023
1 parent 31c7a38 commit 7e2bff0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions generate-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

current=$1
if [ -z "$current" ]; then
echo "Missing argument VERSION"
exit 1
fi

tags=($(git tag --list))

for i in "${!tags[@]}"; do
if [[ "${tags[$i]}" = "$current" ]]; then
previous="${tags[$i - 1]}"
break
fi
done

if [ -z "$previous" ]; then
echo "Invalid tag, or could not find previous tag"
exit 1
fi

echo -e "\e[97mListing changes from \e[96m$previous\e[97m to \e[96m$current\e[0m:\n"

changes=$(git log --pretty=format:"* %h %s" $previous...$current)

echo "## Changelog"
echo "$changes" | grep -v "chore(deps)" | grep -v "Merge " | grep -v "chore(ci)"
echo
echo "### Dependencies"
echo "$changes" | grep "chore(deps)"

0 comments on commit 7e2bff0

Please sign in to comment.