From 6a8007dd96755cd1923cada348c7b79822b41366 Mon Sep 17 00:00:00 2001 From: godcong Date: Thu, 28 Nov 2024 21:18:01 +0800 Subject: [PATCH] ci(runtime): improve changelog generation in release workflow - Update GitHub Actions workflow for generating changelog - Add LATEST_RELEASE variable to GitHub_OUTPUT for better reusability - Fix git log command by adding double dash to exclude commit details --- .github/workflows/release_and_tagging.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_and_tagging.yml b/.github/workflows/release_and_tagging.yml index febb8ba..ec9c1cc 100644 --- a/.github/workflows/release_and_tagging.yml +++ b/.github/workflows/release_and_tagging.yml @@ -60,7 +60,7 @@ jobs: id: generate_changelog run: | LATEST_RELEASE=${{ steps.get_latest_release.outputs.LATEST_RELEASE }} - echo "# Changelog" > changelog.txt + echo "LATEST_RELEASE=$LATEST_RELEASE" >> $GITHUB_OUTPUT if [[ -z "$LATEST_RELEASE" ]]; then # If there's no previous release, get only the current commit's log git config --global core.pager cat @@ -68,8 +68,8 @@ jobs: git log --pretty=format:"* %s **by** @%an" >> changelog.txt else # Get all submission information since the last release - CHANGELOG=$(git log "$LATEST_RELEASE"..HEAD --pretty=format:"* %s **by** @%an") - git log "$LATEST_RELEASE"..HEAD --pretty=format:"* %s **by** @%an" >> changelog.txt + CHANGELOG=$(git log "$LATEST_RELEASE"..HEAD -- --pretty=format:"* %s **by** @%an") + git log "$LATEST_RELEASE"..HEAD -- --pretty=format:"* %s **by** @%an" >> changelog.txt fi - name: Create release