Debian Codegraph @

scripts/generate-release-notes.sh

raw
1 #!/bin/bash
2
3 current=$1
4 if [ -z "$current" ]; then
5 echo "Missing argument VERSION"
6 exit 1
7 fi
8
9 tags=($(git tag --list))
10
11 for i in "${!tags[@]}"; do
12 if [[ "${tags[$i]}" = "$current" ]]; then
13 previous="${tags[$i - 1]}"
14 break
15 fi
16 done
17
18 if [ -z "$previous" ]; then
19 echo "Invalid tag, or could not find previous tag"
20 exit 1
21 fi
22
23 echo -e "\e[97mListing changes from \e[96m$previous\e[97m to \e[96m$current\e[0m:\n"
24
25 changes=$(git log --pretty=format:"* %h %s" $previous...$current)
26
27 echo "## Changelog"
28 echo "$changes" | grep -v "chore(deps)" | grep -v "Merge " | grep -v "chore(ci)"
29 echo
30 echo "### Dependencies"
31 echo "$changes" | grep "chore(deps)"