diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 7895c4162f..9dbb2a9781 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 $version $CHANGES diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 55af979a22..cb5ad78234 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -4,12 +4,33 @@ on: push: branches: - main + # temporary to allow testing the release drafter action + pull_request: + branches: + - main jobs: update_release_draft: runs-on: ubuntu-latest steps: + - 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 + run: | + set -e + echo "::set-output name=version_number::$(jq -r '.version' package.json)" + - name: Draft release notes 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 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}