-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release drafter pulls tag number from package.json automatically #5085
Changes from 12 commits
e92d85a
8fbe562
e81c2f9
c4497dc
25b4d39
09a36f8
9547aaa
d5d126e
6766429
56a12f3
d0de920
2b57bba
19b6d3f
6be9cc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,7 +9,27 @@ 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 }}" | ||||||
version: "v${{ steps.get_version.outputs.version_number }}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it matters, but is version expected to be a version number (just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bartaz
Here's an example image where each field is different to better distinguish them: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmuzina Thanks. So in this case
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bartaz I'm glad you brought this up. It seems like release drafter is doing some sort of logic against So, we don't need |
||||||
commitish: main | ||||||
env: | ||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm a bit rusty on GH actions, and they changed how to do things in the past. Is this the recommended way to store some values? Can you point me to some docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartaz Yes, this is the "new" way to set an output param for a GHA step. See some docs here: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
You may have seen this in the past with a slightly different syntax that was deprecated recently; maybe this looks more familiar: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/