Skip to content

Commit 15ef9a5

Browse files
Merge pull request #35 from hellosign/chore/npm-trusted-publishing
Use npm trusted publishing
2 parents 1a94d1c + 5b6d445 commit 15ef9a5

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ jobs:
4747
- run: npm ci
4848

4949
- run: npm publish --access=public --dry-run
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
5250

5351
# This job runs on merging to "main" branch
5452
# Builds and publishes gem
5553
publish-prod:
5654
runs-on: ubuntu-latest
55+
permissions:
56+
contents: read
57+
id-token: write
5758
if: >-
5859
github.repository == 'hellosign/dropbox-sign-node'
5960
&& github.ref == 'refs/heads/main'
@@ -63,16 +64,19 @@ jobs:
6364
- name: Checkout
6465
uses: actions/checkout@v3
6566

66-
- uses: actions/setup-node@v3
67+
- name: Use Node.js 24 for trusted publishing
68+
uses: actions/setup-node@v4
6769
with:
68-
node-version: '16.x'
70+
node-version: '24.x'
6971
registry-url: 'https://registry.npmjs.org'
7072

7173
- run: npm ci
7274

73-
- run: npm publish --access=public
74-
env:
75-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
75+
- name: Use npm with trusted publishing support
76+
run: npm install --global npm@11.19.1
77+
78+
- name: Publish package with trusted publishing
79+
run: npm publish --access=public
7680

7781
# This job runs on merging to "main" branch
7882
# Creates a new tag using the value in the VERSION file

0 commit comments

Comments
 (0)