From a61aa8e2bec57281655eb1c89c956fd5d42d3fc5 Mon Sep 17 00:00:00 2001 From: ab77 Date: Mon, 7 Nov 2022 15:16:50 -0800 Subject: [PATCH] Generate release notes with git Change-type: patch --- .github/actions/finalize/action.yml | 12 ++++++++++++ .github/actions/publish/action.yml | 1 - scripts/resin | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/finalize/action.yml b/.github/actions/finalize/action.yml index 063a8d7c..79536a49 100644 --- a/.github/actions/finalize/action.yml +++ b/.github/actions/finalize/action.yml @@ -24,6 +24,7 @@ runs: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT + # https://docs.github.com/en/rest/releases - name: Finalize GitHub release if: runner.os == 'Linux' shell: bash --noprofile --norc -eo pipefail -x {0} @@ -32,11 +33,22 @@ runs: [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x + previous_tag="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" + release_notes="$(git log ${previous_tag}..HEAD --pretty=reference)" + gh release edit '${{ github.event.pull_request.head.ref }}' \ + --notes "${release_notes}" \ --title 'v${{ steps.get_release.outputs.version }}' \ --tag 'v${{ steps.get_release.outputs.version }}' \ --prerelease=false \ --draft=false + release_id="$(gh api "/repos/${{ github.repository }}/releases/tags/v${{ steps.get_release.outputs.version }}" \ + -H 'Accept: application/vnd.github+json' | jq -r .id)" + + gh api --method PATCH "/repos/${{ github.repository }}/releases/${release_id}" \ + -H 'Accept: application/vnd.github+json' \ + -F make_latest="true" + env: GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index a7b9bfe4..f134d51e 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -220,7 +220,6 @@ runs: name: ${{ github.event.pull_request.head.ref }} tag_name: ${{ github.event.pull_request.head.ref }} draft: true - generate_release_notes: true prerelease: true token: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} files: | diff --git a/scripts/resin b/scripts/resin index 652fdd41..8dfa21cf 160000 --- a/scripts/resin +++ b/scripts/resin @@ -1 +1 @@ -Subproject commit 652fdd41851cda614a6a4c29cf7a14ce17bc9b6b +Subproject commit 8dfa21cfc23b1dbc0eaa22b5dbdf1f5c796b0c2c