Skip to content

Commit d42e699

Browse files
fix: simplify post-release.yml with release_tag instead of npm pkg get (#1663)
## PR Checklist - [x] Addresses an existing open issue: fixes #1115 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Uses the same `{release_tag}` as the _GitHub releases_ link. 💖
1 parent f6d54d1 commit d42e699

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

.github/workflows/post-release.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jobs:
55
- uses: actions/checkout@v4
66
with:
77
fetch-depth: 0
8-
- run: echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"
98
- uses: apexskier/github-release-commenter@v1
109
with:
1110
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -15,7 +14,7 @@ jobs:
1514
The release is available on:
1615
1716
* [GitHub releases](https://github.com/JoshuaKGoldberg/create-typescript-app/releases/tag/{release_tag})
18-
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/create-typescript-app/v/${{ env.npm_version }})
17+
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/create-typescript-app/v/{release_tag})
1918
2019
Cheers! 📦🚀
2120

src/steps/writing/creation/dotGitHub/createWorkflows.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ describe("createWorkflows", () => {
197197
- uses: actions/checkout@v4
198198
with:
199199
fetch-depth: 0
200-
- run: echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"
201200
- uses: apexskier/github-release-commenter@v1
202201
with:
203202
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
@@ -207,7 +206,7 @@ describe("createWorkflows", () => {
207206
The release is available on:
208207
209208
* [GitHub releases](https://github.com/StubOwner/stub-repository/releases/tag/{release_tag})
210-
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/stub-repository/v/\${{ env.npm_version }})
209+
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/stub-repository/v/{release_tag})
211210
212211
Cheers! 📦🚀
213212

src/steps/writing/creation/dotGitHub/createWorkflows.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ export function createWorkflows(options: Options) {
155155
},
156156
steps: [
157157
{ uses: "actions/checkout@v4", with: { "fetch-depth": 0 } },
158-
{
159-
run: `echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"`,
160-
},
161158
{
162159
uses: "apexskier/github-release-commenter@v1",
163160
with: {
@@ -167,7 +164,7 @@ export function createWorkflows(options: Options) {
167164
The release is available on:
168165
169166
* [GitHub releases](https://github.com/${options.owner}/${options.repository}/releases/tag/{release_tag})
170-
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/${options.repository}/v/\${{ env.npm_version }})
167+
* [npm package (@latest dist-tag)](https://www.npmjs.com/package/${options.repository}/v/{release_tag})
171168
172169
Cheers! 📦🚀
173170
`,

0 commit comments

Comments
 (0)