Skip to content

Commit 8bd5c1c

Browse files
fix: use npm pkg version in post-release (#428)
## PR Checklist - [x] Addresses an existing open issue: fixes #427 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Uses `npm pkg get version` to set the npm version in an `npm_version` env variable per https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable. Then uses it in the comment template.
1 parent be6f827 commit 8bd5c1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/post-release.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ jobs:
33
name: Comment on relevant PRs and issues
44
runs-on: ubuntu-latest
55
steps:
6+
- run: echo "npm_version=$(npm pkg get version)" >> "$GITHUB_ENV"
67
- uses: apexskier/github-release-commenter@v1
78
with:
89
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -11,8 +12,8 @@ jobs:
1112
1213
The release is available on:
1314
14-
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/template-typescript-node-package/v/{release_tag})
15-
* [GitHub release](https://github.com/JoshuaKGoldberg/template-typescript-node-package/releases/tag/v{release_tag})
15+
* [GitHub releases]({release_link})
16+
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/template-typescript-node-package/v/${{ env.npm_version }}})
1617
1718
Cheers! 📦🚀
1819

0 commit comments

Comments
 (0)