Skip to content

Commit

Permalink
release-drafter automatically grabs tag number from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuzina committed May 7, 2024
1 parent e6d414d commit e92d85a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 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 $version
$CHANGES
21 changes: 21 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit e92d85a

Please sign in to comment.