From 14f47b047373f952a37ff68dff8c87c650958d1e Mon Sep 17 00:00:00 2001 From: Tristan Teufel Date: Fri, 29 Dec 2023 10:17:02 +0100 Subject: [PATCH] create changelog based on latest commits --- .github/scripts/get_commits.sh | 13 +++++++++++++ .github/workflows/release.yml | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 .github/scripts/get_commits.sh diff --git a/.github/scripts/get_commits.sh b/.github/scripts/get_commits.sh new file mode 100644 index 0000000..1e6770c --- /dev/null +++ b/.github/scripts/get_commits.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Set GIT_PAGER to cat to disable paging +export GIT_PAGER=cat + +# Get the last release tag +tag=$(curl --silent "https://api.github.com/repos/firsttris/ccu-addon-mui/releases/latest" | jq -r .tag_name) + +# Get the SHA of the last release +sha=$(git rev-list -n 1 $tag) + +# Get the commits since the last release +git log --pretty=format:"%h %s" $sha..HEAD \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11b1b8f..14ab623 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,11 @@ jobs: - name: Get version id: packagejson uses: martinbeentjes/npm-get-version-action@v1.3.1 + + - name: Create Changelog with commits since last release + run: | + chmod +x ./.github/scripts/get_commits.sh + ./.github/scripts/get_commits.sh > commit_log.txt - name: Upload Release uses: ncipollo/release-action@v1.13.0 @@ -35,4 +40,5 @@ jobs: artifacts: 'mui-${{ steps.packagejson.outputs.current-version }}.tar.gz' token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.packagejson.outputs.current-version }} + bodyFile: commit_log.txt \ No newline at end of file