Skip to content

Commit c93d518

Browse files
committed
migrate npm publish to OIDC trusted publishing
This commit updates the release workflow to use npm trusted publishing (OIDC) instead of NPM_TOKEN. it also adds required job permissions for npm OIDC auth: id-token: write and contents: read. Npm publish was kept explicit with --access public. package.json repository metadata was updated to npm-recommended object format. Issue:HD-4608
1 parent 8a1016d commit c93d518

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@ jobs:
3737
publish-npm:
3838
runs-on: ubuntu-latest
3939
needs: check
40+
permissions:
41+
id-token: write
42+
contents: read
4043
environment: npmjs
4144
steps:
4245
- uses: actions/checkout@v4
4346
# Setup .npmrc file to publish to npmjs.org
4447
- uses: actions/setup-node@v4
4548
with:
46-
node-version: '22'
49+
node-version: '24'
4750
registry-url: 'https://registry.npmjs.org'
4851
- run: npm install
49-
- run: npm publish
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
- run: npm publish --access public
5253
release-github:
5354
runs-on: ubuntu-latest
5455
needs:

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
"sourceMap": true,
3636
"instrument": true
3737
},
38-
"repository": "git://github.com/scality/hdclient.git ",
38+
"repository": {
39+
"type": "git",
40+
"url": "https://github.com/scality/hdclient.git"
41+
},
3942
"author": "Maxime Lubin",
4043
"dependencies": {
4144
"httpagent": "github:scality/httpagent#1.1.0",

0 commit comments

Comments
 (0)