Skip to content

Commit cd2f3e3

Browse files
committed
Update publish-npm.yml
1 parent 8abf662 commit cd2f3e3

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Node
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 20
25+
node-version: 22
2626

2727
- name: Get package version
2828
id: package_version
@@ -68,6 +68,7 @@ jobs:
6868

6969
permissions:
7070
contents: read
71+
id-token: write
7172

7273
steps:
7374
- name: Checkout repository
@@ -76,9 +77,14 @@ jobs:
7677
- name: Setup Node
7778
uses: actions/setup-node@v4
7879
with:
79-
node-version: 20
80+
node-version: 22
8081
registry-url: https://registry.npmjs.org/
8182

83+
- name: Show tool versions
84+
run: |
85+
node --version
86+
npm --version
87+
8288
- name: Install dependencies
8389
run: npm ci
8490

@@ -99,16 +105,6 @@ jobs:
99105
echo "Version ${PACKAGE_NAME}@${PACKAGE_VERSION} does not exist on npm. Publishing."
100106
fi
101107
102-
- name: Verify npm auth
103-
run: npm whoami
104-
env:
105-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
106-
107-
- name: Publish to NPM
108+
- name: Publish to NPM with trusted publishing
108109
if: steps.npm_check.outputs.exists == 'false'
109-
run: |
110-
echo "::remove-mask::$NODE_AUTH_TOKEN"
111-
echo "NPM TOKEN $NODE_AUTH_TOKEN"
112-
npm publish --access public
113-
env:
114-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
110+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)