From 3942bf8e37f9f9f96e99c69ccc7b08bfaf177384 Mon Sep 17 00:00:00 2001 From: Sarah French Date: Tue, 1 Nov 2022 17:47:47 +0000 Subject: [PATCH] Update release note generation command (#12920) * Update release note generation command This newer approach doesn't depend on tags being merged into a single branch, and works with our release branch strategy * Update `git tag` command in release note generation Add optional pattern arg to list command, so only version tags starting with v are processed --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4e469b30a2..e118224352c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,10 @@ jobs: with: fetch-depth: 0 - name: Generate Release Notes - run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt + run: | + export PREV_TAG=$(git tag --list 'v*' --sort=-version:refname | head -n 2 | tail -n 1) + export PREV_VERSION=${PREV_TAG//v} + sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $PREV_VERSION/q;p" CHANGELOG.md > release-notes.txt - uses: actions/upload-artifact@v2 with: name: release-notes