Skip to content

Commit 899bad0

Browse files
roderikclaude
andcommitted
fix: switch to npm Trusted Publishing with OIDC
- Update all package.json publish-npm scripts to use `npm publish --provenance` - Add `id-token: write` permission to workflow for OIDC authentication - Remove NPM_TOKEN-based authentication (no longer needed with Trusted Publishing) - Remove npmrc setup step (OIDC handles auth automatically) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 91cd31a commit 899bad0

14 files changed

Lines changed: 15 additions & 22 deletions

File tree

.github/workflows/qa.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ permissions:
2323
contents: read
2424
pull-requests: write
2525
packages: write
26+
id-token: write
2627

2728
concurrency:
2829
group:
@@ -47,13 +48,13 @@ jobs:
4748
security-events: write
4849
actions: read
4950
packages: write
51+
id-token: write
5052
env:
5153
SLACK_BOT_TOKEN: ""
5254
SLACK_CHANNEL_ID: ""
5355
HARBOR_USER: ""
5456
HARBOR_PASS: ""
5557
PAT_TOKEN: ""
56-
NPM_TOKEN: ""
5758
TAG: ""
5859
VERSION: ""
5960
CONSOLE_GRAPHQL: ""
@@ -80,7 +81,6 @@ jobs:
8081
HARBOR_USER: op://platform/harbor/username
8182
HARBOR_PASS: op://platform/harbor/password
8283
PAT_TOKEN: op://platform/github-commit-pat/credential
83-
NPM_TOKEN: op://platform/npmjs/credential
8484

8585
# Label QA as running and notify Slack (only for non-draft PRs)
8686
- name: Label QA as running
@@ -118,7 +118,6 @@ jobs:
118118
uses: settlemint/shared-actions/.github/actions/setup-dependencies@main
119119
with:
120120
github_token: ${{ secrets.GITHUB_TOKEN }}
121-
npm_token: ${{ env.NPM_TOKEN }}
122121
disable_node: "true"
123122

124123
- name: Inject slug/short variables
@@ -182,12 +181,6 @@ jobs:
182181
183182
echo "Updated version to $VERSION"
184183
185-
- name: Login to npm
186-
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'release'
187-
run: |
188-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
189-
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" >> ~/.npmrc
190-
191184
- name: Setup git user
192185
run: |
193186
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"

sdk/blockscout/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"test": "bun test",
4848
"test:coverage": "bun test --coverage",
4949
"typecheck": "tsc --noEmit",
50-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
50+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
5151
"prepack": "cp ../../LICENSE .",
5252
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/blockscout.ts --out ./docs"
5353
},

sdk/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"test": "bun test",
3939
"test:coverage": "bun test --coverage",
4040
"typecheck": "tsc --noEmit",
41-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
41+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
4242
"docs": "bun scripts/create-docs.ts",
4343
"prepack": "cp ../../LICENSE ."
4444
},

sdk/eas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"publint": "publint run --strict",
4646
"attw": "attw --pack .",
4747
"typecheck": "tsc --noEmit",
48-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
48+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
4949
"prepack": "cp ../../LICENSE .",
5050
"codegen": "gql-tada generate-output",
5151
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/eas.ts --out ./docs"

sdk/hasura/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"test": "bun test",
5858
"test:coverage": "bun test --coverage",
5959
"typecheck": "tsc --noEmit",
60-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
60+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
6161
"prepack": "cp ../../LICENSE .",
6262
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/hasura.ts src/postgres.ts --out ./docs"
6363
},

sdk/ipfs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"test": "bun test",
4848
"test:coverage": "bun test --coverage",
4949
"typecheck": "tsc --noEmit",
50-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
50+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
5151
"prepack": "cp ../../LICENSE .",
5252
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/ipfs.ts --out ./docs"
5353
},

sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"test": "bun test",
4949
"test:coverage": "bun test --coverage",
5050
"typecheck": "tsc --noEmit",
51-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
51+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
5252
"prepack": "cp ../../LICENSE .",
5353
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/settlemint.ts --out ./docs"
5454
},

sdk/mcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"build": "bun run build.ts",
3737
"dev": "tsdown --watch ./src",
3838
"typecheck": "tsc --noEmit",
39-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
39+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
4040
"prepack": "cp ../../LICENSE ."
4141
},
4242
"dependencies": {

sdk/minio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"test": "bun test",
4848
"test:coverage": "bun test --coverage",
4949
"typecheck": "tsc --noEmit",
50-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
50+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
5151
"prepack": "cp ../../LICENSE .",
5252
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/minio.ts --out ./docs"
5353
},

sdk/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"test": "bun test",
6868
"test:coverage": "bun test --coverage",
6969
"typecheck": "tsc --noEmit",
70-
"publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
70+
"publish-npm": "npm publish --provenance --tag ${TAG} --access public || exit 0",
7171
"prepack": "cp ../../LICENSE .",
7272
"docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/components/test.tsx src/config/with-settlemint.ts --out ./docs"
7373
},

0 commit comments

Comments
 (0)