Skip to content

Commit 3975d3b

Browse files
committed
fix npm install error
1 parent f7d14ce commit 3975d3b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ jobs:
3838
node-version: 22
3939
cache: "pnpm"
4040

41-
- name: Update npm for OIDC support
42-
run: npm install -g npm@latest # Needs 11.5.1+ for npm trusted publishing
41+
- name: Install npm 11+ for OIDC provenance publishing
42+
run: corepack enable npm && corepack install -g npm@latest
43+
env:
44+
COREPACK_ENABLE_STRICT: 0
4345

4446
- name: Install dependencies
4547
run: pnpm install --frozen-lockfile
@@ -60,12 +62,14 @@ jobs:
6062
if: github.event_name == 'workflow_dispatch'
6163
id: version
6264
run: |
63-
npm version ${{ github.event.inputs.version_type }}
65+
pnpm version ${{ github.event.inputs.version_type }}
6466
echo "new_version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
6567
git push --follow-tags
6668
6769
- name: Publish to npm
6870
run: npm publish --provenance
71+
env:
72+
COREPACK_ENABLE_STRICT: 0
6973

7074
- name: Create GitHub release (manual trigger only)
7175
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)