add command to generate changelog

pull/21719/head
jm96441n 3 months ago
parent 24684b3ae6
commit e7993e328b

@ -641,3 +641,4 @@ gen-changelog: ## Generate changelog entry for the current branch based on the c
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

@ -0,0 +1,27 @@
#! /bin/bash
set -eo pipefail
curdir=$(pwd)
if [[ ! $curdir == *"enterprise"* ]]; then
echo "This script should be run from the enterprise directory."
exit 1
fi
LAST_RELEASE_GIT_TAG="$1"
if [ -z "$LAST_RELEASE_GIT_TAG" ]; then
read -p "Enter the last release git tag (vX.Y.Z): " LAST_RELEASE_GIT_TAG
fi
if [ -z "$LAST_RELEASE_GIT_TAG" ]; then
echo "Last release git tag is required."
exit 1
fi
if [[ ! $LAST_RELEASE_GIT_TAG == v* ]]; then
echo "Last release git tag should start with 'v'."
exit 1
fi
go run github.com/hashicorp/go-changelog/cmd/changelog-build@latest -last-release ${LAST_RELEASE_GIT_TAG}+ent -entries-dir .changelog/ -changelog-template .changelog/changelog.tmpl -note-template .changelog/note.tmpl -this-release $(git rev-parse HEAD)
Loading…
Cancel
Save