Skip to content

Commit

Permalink
ci(runtime): improve changelog generation in release workflow
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
godcong committed Nov 28, 2024
1 parent 5f89728 commit 6a8007d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release_and_tagging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ 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
# git log --pretty=format:"* %s **by** @%an"
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
Expand Down

0 comments on commit 6a8007d

Please sign in to comment.