From 7ed20893c06d4a2297e2ffdd2b25c411434d33a1 Mon Sep 17 00:00:00 2001 From: tico88612 <17496418+tico88612@users.noreply.github.com> Date: Sat, 20 Apr 2024 00:12:46 +0800 Subject: [PATCH] Feat: add generate release note script Signed-off-by: tico88612 <17496418+tico88612@users.noreply.github.com> --- hack/gen_relnotes.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 hack/gen_relnotes.sh diff --git a/hack/gen_relnotes.sh b/hack/gen_relnotes.sh new file mode 100755 index 000000000..244bcf9a0 --- /dev/null +++ b/hack/gen_relnotes.sh @@ -0,0 +1,36 @@ +#!/bin/bash -e +set -x + +if [[ ! -v GITHUB_TOKEN ]]; then + echo "GITHUB_TOKEN is not set, please set it with a token with read permissions on commits and PRs" + exit 1 +fi + +script_dir=$(dirname "$(readlink -f "$0")") + +branch=$1 +from=$2 +to=$3 +release_notes=$(mktemp) + +end() { + rm $release_notes +} + +trap end EXIT SIGINT SIGTERM SIGSTOP + +GOFLAGS=-mod=mod go run k8s.io/release/cmd/release-notes@v0.16.5 \ + --branch $branch \ + --required-author "" \ + --org metallb \ + --dependencies=false \ + --repo metallb-operator \ + --start-sha $from \ + --end-sha $to \ + --output $release_notes + +cat $release_notes + + +echo "Contributors" +git log --format="%aN" $(git merge-base $to $from)..$to | sort -u | tr '\n' ',' | sed -e 's/,/, /g'