Skip to content

Commit 51ea479

Browse files
CI: Fix #831 - Pinned npm version with corepack (#832)
* chore: add `corepack`'s `packageManager` pin for `npm@11.14.1` * chore: adapt gh actions to `corepack` package manager install * fix: sync `package-lock.json` versions * chore: unify `actions/setup-node` version to `v4.4.0` * chore: update `packageManager` pin to `npm@11.16.0` * chore: install `corepack@0.35.0` before enabling to fix signature verification errors * chore: allow `fsevents` install scripts in package configuration * chore: execute `audit fix` script * chore: exclude `.claude` from git * chore: simplify corepack setup and update Node versions in CI workflows Both workflows now pin Node 22.22.3 — which bundles corepack 0.34.6 carrying both the legacy jl3b… and rotated DhQ8… npm registry keys — and the npm install --global corepack@... workaround steps are no longer needed
1 parent 3d80848 commit 51ea479

5 files changed

Lines changed: 73 additions & 50 deletions

File tree

.github/workflows/ci-build-test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2222
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
23-
with:
24-
node-version: ${{ matrix.node-version }}
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
# setup-node must be called twice to correctly cache corepack-managed npm.
26+
# See: https://github.com/actions/setup-node/issues/531#issuecomment-3335630863
27+
- name: Enable Corepack
28+
shell: bash
29+
run: corepack enable npm
30+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
31+
with:
32+
cache: npm
2533
- name: Install dependencies
2634
timeout-minutes: 10
2735
run: |

.github/workflows/publish-npm.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ jobs:
1313
id-token: write
1414
steps:
1515
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
16-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
16+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1717
with:
18-
node-version: '18.x'
18+
node-version: '22'
1919
registry-url: 'https://registry.npmjs.org'
20-
- run: npm install -g npm
20+
# setup-node must be called twice to correctly cache corepack-managed npm.
21+
# See: https://github.com/actions/setup-node/issues/531#issuecomment-3335630863
22+
- name: Enable Corepack
23+
shell: bash
24+
run: corepack enable npm
25+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
26+
with:
27+
cache: npm
2128
- run: npm ci
2229
- run: npm publish --provenance --access public
2330
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ Icon
3030
# Files that might appear on external disk
3131
.Spotlight-V100
3232
.Trashes
33+
34+
# Agents
35+
.claude

package-lock.json

Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,10 @@
304304
"type": "github",
305305
"url": "https://github.com/sponsors/faisalman"
306306
}
307-
]
307+
],
308+
"packageManager": "npm@11.16.0+sha512.03be172fc3b199c7a06433163e459be5b110a6983c1dd6305b7ac10f6b0fa12e1440755a8df6b1064ab2ccb789df0474919fb9c684e322dc57685ede21752ccb",
309+
"allowScripts": {
310+
"fsevents@2.1.3": true,
311+
"fsevents@2.3.2": true
312+
}
308313
}

0 commit comments

Comments
 (0)