From d29b24e005c5b1d12ab8767ad51f745574ae49e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Thu, 22 Feb 2024 13:07:20 +0100 Subject: [PATCH] [chore] Automate adding release notes to the release --- .ci/create-release-github.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.ci/create-release-github.sh b/.ci/create-release-github.sh index 8557ed7e75..d0acf5bf90 100755 --- a/.ci/create-release-github.sh +++ b/.ci/create-release-github.sh @@ -1,9 +1,14 @@ #!/bin/bash -OPERATOR_VERSION=$(git describe --tags) +NOTES_FILE=/tmp/notes.md +OPERATOR_VERSION=$(git describe --tags --abbrev=0) +PREVIOUS_OPERATOR_VERSION=$(git describe --tags --abbrev=0 "${OPERATOR_VERSION}^") +# Note: Changelog headers don't have the `v` prefix, so we need to drop the first letter in the sed expression below +sed -n "/${OPERATOR_VERSION:1}/,/${PREVIOUS_OPERATOR_VERSION:1}/{/${PREVIOUS_OPERATOR_VERSION:1}/!p;}" CHANGELOG.md >${NOTES_FILE} gh config set prompt disabled gh release create \ -t "Release ${OPERATOR_VERSION}" \ + --notes-file ${NOTES_FILE} \ "${OPERATOR_VERSION}" \ 'dist/opentelemetry-operator.yaml#Installation manifest for Kubernetes'