From a8bc6f546805da686d02b19330196116e376597d Mon Sep 17 00:00:00 2001 From: ngosang Date: Sat, 9 Jan 2021 00:13:05 +0100 Subject: [PATCH] CI/CD: Generate release changelog from commits. resolves #34 --- .github/workflows/release.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b60123..44c8685 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,19 +7,24 @@ on: jobs: build: - name: Create Release + name: Create release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 # get all commits, branches and tags (required for the changelog) - - name: Build Changelog - id: github_release - uses: mikepenz/release-changelog-builder-action@main - env: - GITHUB_TOKEN: ${{ secrets.GH_PAT }} + - name: Build changelog + id: github_changelog + run: | + changelog=$(git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline) + changelog="${changelog//'%'/'%25'}" + changelog="${changelog//$'\n'/'%0A'}" + changelog="${changelog//$'\r'/'%0D'}" + echo "##[set-output name=changelog;]${changelog}" - - name: Create Release + - name: Create release id: create_release uses: actions/create-release@v1 env: @@ -27,6 +32,6 @@ jobs: with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} - body: ${{ steps.github_release.outputs.changelog }} + body: ${{ steps.github_changelog.outputs.changelog }} draft: false prerelease: false