-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: add generate release note script
Signed-off-by: tico88612 <[email protected]>
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] \ | ||
--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' |