Skip to content

Commit

Permalink
Release drafter pulls tag number from package.json automatically (#5085)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuzina committed May 10, 2024
1 parent e6d414d commit 4109529
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
label: 'Feature 🎁'
Expand All @@ -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
21 changes: 20 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 4109529

Please sign in to comment.