Skip to content

Commit 1fa3692

Browse files
committed
fix: npm token env var
1 parent f95de9b commit 1fa3692

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

.github/workflows/npm-publish.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# @format
2+
13
name: release-if-necessary
24

35
on:
@@ -12,18 +14,18 @@ jobs:
1214
strategy:
1315
matrix:
1416
package:
15-
- "@requestnetwork/add-stakeholder"
16-
- "@requestnetwork/create-invoice-form"
17-
- "@requestnetwork/invoice-dashboard"
17+
- '@requestnetwork/add-stakeholder'
18+
- '@requestnetwork/create-invoice-form'
19+
- '@requestnetwork/invoice-dashboard'
1820
steps:
1921
- name: Checkout repository 🛎️
2022
uses: actions/checkout@v4
2123

2224
- name: Set up Node.js
2325
uses: actions/setup-node@v3
2426
with:
25-
node-version: "18"
26-
registry-url: "https://registry.npmjs.org"
27+
node-version: '18'
28+
registry-url: 'https://registry.npmjs.org'
2729

2830
- name: Install dependencies 📥
2931
run: npm ci
@@ -39,14 +41,9 @@ jobs:
3941
echo "is-release-needed=$IS_RELEASE_NEEDED"
4042
echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT
4143
42-
- name: Setup .npmrc file to publish to npm 📝
43-
if: steps.is-release-needed.outputs.is-release-needed == 'true'
44-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.REQUEST_BOT_NPM_TOKEN }}" > ~/.npmrc
45-
4644
- name: Publish package on NPM 📦
4745
if: steps.is-release-needed.outputs.is-release-needed == 'true'
4846
run: |
49-
npm config set registry https://registry.npmjs.org
50-
npm whoami || { echo "Failed to identify npm user."; exit 1; }
51-
npm config get registry || { echo "Failed to get npm registry."; exit 1; }
5247
npm publish --workspace=${{ matrix.package }} --dry-run
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}

0 commit comments

Comments
 (0)