Skip to content

Commit 861fbc1

Browse files
authored
fix(cd): correct npm action to use the credentials when attempting to publish
1 parent bb3bde6 commit 861fbc1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/publish-npm.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,29 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
13+
id-token: write
1314
packages: write
1415

1516
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
2119
with:
2220
node-version: '22.x'
2321
cache: yarn
2422

23+
- name: Add .npmrc
24+
run: cp .npmrc.template .npmrc
25+
2526
- name: Install dependencies
2627
run: yarn install
2728

2829
- name: Build package
2930
run: yarn build
3031

32+
- name: Set the NPM registry with token
33+
run: |
34+
echo "registry=https://registry.npmjs.org/" > .npmrc
35+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
36+
3137
- name: Publish to NPM
32-
run: npm publish --scope=@internxt --registry=https://registry.npmjs.org/ --access public --tag latest
33-
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
run: npm publish --scope=@internxt --access public

0 commit comments

Comments
 (0)