Skip to content

Commit 2dff393

Browse files
committed
Avoid writing NPM_AUTH_TOKEN to disk
1 parent ca94f7e commit 2dff393

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.github/workflows/publish-beta.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ jobs:
2828
- name: Test
2929
if: steps.check.outputs.changed == 'true' && contains(steps.check.outputs.version, 'beta')
3030
run: pnpm test
31-
- name: Setup publish token
32-
if: steps.check.outputs.changed == 'true' && contains(steps.check.outputs.version, 'beta')
33-
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
34-
env:
35-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3631
- name: Publish
3732
if: steps.check.outputs.changed == 'true' && contains(steps.check.outputs.version, 'beta')
33+
# We need --no-git-checks because we swap a boolean to allow more lax types
34+
# in the published package.
3835
run: pnpm publish --tag beta --no-git-checks
36+
env:
37+
npm_config_//registry.npmjs.org/:_authToken: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/publish-lts.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ jobs:
2828
- name: Test
2929
if: steps.check.outputs.changed == 'true'
3030
run: pnpm test
31-
- name: Setup publish token
32-
if: steps.check.outputs.changed == 'true'
33-
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
34-
env:
35-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3631
- name: Publish
3732
if: steps.check.outputs.changed == 'true'
33+
# We need --no-git-checks because we swap a boolean to allow more lax types
34+
# in the published package.
3835
run: pnpm publish --tag lts --no-git-checks
36+
env:
37+
npm_config_//registry.npmjs.org/:_authToken: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ jobs:
3030
- name: Test
3131
if: steps.check.outputs.changed == 'true'
3232
run: pnpm test
33-
- name: Setup publish token
34-
if: steps.check.outputs.changed == 'true'
35-
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
36-
env:
37-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3833
- name: Publish
3934
if: steps.check.outputs.changed == 'true'
35+
# We need --no-git-checks because we swap a boolean to allow more lax types
36+
# in the published package.
4037
run: pnpm publish --no-git-checks
38+
env:
39+
npm_config_//registry.npmjs.org/:_authToken: ${{ secrets.NPM_AUTH_TOKEN }}
4140
- name: Generate Release
4241
if: steps.check.outputs.changed == 'true'
4342
run: |

0 commit comments

Comments
 (0)