Skip to content

Commit fa7419d

Browse files
committed
fix: npm provenance (#37)
Enable OIDC for trusted publishing and npm provenance.
1 parent e3b739d commit fa7419d

4 files changed

Lines changed: 5244 additions & 7733 deletions

File tree

.github/workflows/cd.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010

1111
jobs:
1212
publish:
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1413
runs-on: ubuntu-latest
1514
permissions:
1615
contents: write
@@ -28,6 +27,7 @@ jobs:
2827
uses: actions/setup-node@v4
2928
with:
3029
node-version: "24"
30+
registry-url: "https://registry.npmjs.org"
3131
cache: "npm"
3232

3333
- name: Install dependencies
@@ -36,6 +36,17 @@ jobs:
3636
- name: Build the project
3737
run: npm run build
3838

39+
- name: Upgrade npm for OIDC trusted publishing
40+
run: npm i -g npm@^11.7.0
41+
- name: Debug npm
42+
run: |
43+
node -v
44+
npm -v
45+
npm config ls -l
46+
npm config get auth-type || true
47+
echo '--- .npmrc ---'
48+
test -f ~/.npmrc && sed -n '1,200p' ~/.npmrc || echo 'no ~/.npmrc'
49+
3950
- name: Release
4051
env:
4152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: "24"
23+
registry-url: "https://registry.npmjs.org"
2324
cache: "npm"
2425

2526
- name: Install dependencies

0 commit comments

Comments
 (0)