From 066659209502e1594bddd6d69c3eda656e68ef27 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 22 Sep 2022 13:04:29 -0600 Subject: [PATCH] feat: add support for adding major release description to the release notes --- entrypoint.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 78493ce..89559da 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,8 +12,17 @@ git fetch "$INPUTS_REMOTE" +refs/tags/*:refs/tags/* NEW_TAG=${GITHUB_REF/refs\/tags\//} MAJOR_VERSION=$(echo "$NEW_TAG" | cut -d. -f1) +if git tag -l "$MAJOR_VERSION"; then + echo "Adding $MAJOR_VERSION to release notes..." + { + echo "# Changes in $MAJOR_VERSION" + gh release view "$MAJOR_VERSION" --json body --jq '.body' + printf "\n---\n\n" + } >> "$INPUTS_RELEASE_NOTES_FILE" +fi + for tag in $(git tag -l "$MAJOR_VERSION.*"); do - echo "Adding $tag to release notes" + echo "Adding $tag to release notes..." { echo "# Changes in $tag" gh release view "$tag" --json body --jq '.body'