diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 7895c4162..934bb0c7b 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1,3 @@ -name-template: 'v$NEXT_PATCH_VERSION' -tag-template: 'v$NEXT_PATCH_VERSION' categories: - title: '🚀 Features' label: 'Feature 🎁' @@ -18,6 +16,6 @@ template: | Install with NPM: https://www.npmjs.com/package/vanilla-framework Visit the documentation at https://vanillaframework.io/docs - ## New in Vanilla v$NEXT_PATCH_VERSION + ## New in Vanilla v$INPUT_VERSION $CHANGES diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 55af979a2..b41328a2e 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -9,7 +9,26 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - name: Draft release notes + - name: Checkout repo + uses: actions/checkout@v4 + with: + # Only need package.json as it is used by the get_version step to pass tag number into release-drafter + sparse-checkout: package.json + + - name: Get version number from package.json + id: get_version + shell: bash + run: | + set -e + echo "version_number=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT + + - name: Draft release notes for v${{ steps.get_version.outputs.version_number }} uses: release-drafter/release-drafter@v6 + with: + # Setting tag and name override the name-template and tag-template. + # See https://github.com/release-drafter/release-drafter?tab=readme-ov-file#action-inputs for more + tag: v${{ steps.get_version.outputs.version_number }} + name: v${{ steps.get_version.outputs.version_number }} + commitish: main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}