Skip to content

Commit 94b9f0a

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

4 files changed

Lines changed: 5245 additions & 7737 deletions

File tree

.github/workflows/cd.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
name: CD Pipeline
22

33
on:
4-
workflow_run:
5-
workflows: ["CI Pipeline"]
6-
types:
7-
- completed
4+
pull_request:
85
branches:
96
- main
107

118
jobs:
129
publish:
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1410
runs-on: ubuntu-latest
1511
permissions:
1612
contents: write
@@ -28,6 +24,7 @@ jobs:
2824
uses: actions/setup-node@v4
2925
with:
3026
node-version: "24"
27+
registry-url: "https://registry.npmjs.org"
3128
cache: "npm"
3229

3330
- name: Install dependencies
@@ -36,6 +33,17 @@ jobs:
3633
- name: Build the project
3734
run: npm run build
3835

36+
- name: Upgrade npm for OIDC trusted publishing
37+
run: npm i -g npm@^11.7.0
38+
- name: Debug npm
39+
run: |
40+
node -v
41+
npm -v
42+
npm config ls -l
43+
npm config get auth-type || true
44+
echo '--- .npmrc ---'
45+
test -f ~/.npmrc && sed -n '1,200p' ~/.npmrc || echo 'no ~/.npmrc'
46+
3947
- name: Release
4048
env:
4149
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)