Skip to content

Commit b75307d

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

3 files changed

Lines changed: 5245 additions & 7735 deletions

File tree

.github/workflows/cd.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
publish:
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
release:
1413
runs-on: ubuntu-latest
1514
permissions:
1615
contents: write
@@ -30,14 +29,26 @@ jobs:
3029
node-version: "24"
3130
cache: "npm"
3231

32+
- name: Install npm 11 (required for OIDC)
33+
run: |
34+
corepack disable
35+
npm i -g npm@11
36+
echo "npm version: $(npm -v)"
37+
3338
- name: Install dependencies
3439
run: npm ci
3540

36-
- name: Build the project
41+
- name: Build
3742
run: npm run build
3843

44+
- name: Remove GitHub-injected npmrc (breaks OIDC)
45+
run: |
46+
rm -f ~/.npmrc
47+
rm -f /home/runner/work/_temp/.npmrc || true
48+
3949
- name: Release
4050
env:
4151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4252
NPM_CONFIG_PROVENANCE: true
53+
NPM_CONFIG_AUTH_TYPE: oidc
4354
run: npx semantic-release

0 commit comments

Comments
 (0)