From 183b0b47f8baf35e53ef270bcec97c6167425fd3 Mon Sep 17 00:00:00 2001 From: Rui Pereira Date: Thu, 12 Oct 2023 22:50:30 +0100 Subject: [PATCH] Fix release workflow not generating changelog properly --- .github/workflows/release.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ddcd42..b034ea8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,17 +31,11 @@ jobs: run: | git fetch --unshallow --tags tag=$(git tag --sort version:refname | tail -n 2 | head -n 1) - if [ "$tag" ]; then - changelog=$(git log --oneline --no-decorate $tag..HEAD) - else - changelog=$(git log --oneline --no-decorate) - fi - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A' - }" - changelog=" - ${changelog//$'\r'/'%0D'}" - echo "CHANGELOG<<$EOF" >> "$GITHUB_OUTPUT" - echo "$changelog" >> "$GITHUB_OUTPUT" - echo "$EOF" >> "$GITHUB_OUTPUT" + changelog=$(git log $tag..HEAD --pretty=format:'- %h %s%n' --reverse) + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + echo "CHANGELOG<<$EOF" >> $GITHUB_OUTPUT + echo "$changelog" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT - name: Create Draft Release uses: softprops/action-gh-release@v1