File: generate-release-notes.sh

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.8.15-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,200 kB
  • sloc: sh: 49; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)"