Skip to content

Commit 75c5fdf

Browse files
Copilothotlong
andauthored
fix: replace pnpm/action-setup@v6 with corepack in all CI workflows to fix ERR_PNPM_BROKEN_LOCKFILE
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/d0e206fc-2b0c-43f9-b31d-f37a660851c9 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ef5eb70 commit 75c5fdf

File tree

7 files changed

+49
-26
lines changed

7 files changed

+49
-26
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ jobs:
5656
with:
5757
node-version: '20'
5858

59-
- name: Install pnpm
60-
uses: pnpm/action-setup@v6
59+
- name: Enable Corepack
60+
run: corepack enable
61+
62+
- name: Verify pnpm version
63+
run: pnpm --version
6164

6265
- name: Get pnpm store directory
6366
shell: bash
@@ -68,9 +71,9 @@ jobs:
6871
uses: actions/cache@v5
6972
with:
7073
path: ${{ env.STORE_PATH }}
71-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
74+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
7275
restore-keys: |
73-
${{ runner.os }}-pnpm-store-v2-
76+
${{ runner.os }}-pnpm-store-v3-
7477
7578
- name: Install dependencies
7679
run: pnpm install --frozen-lockfile
@@ -105,8 +108,11 @@ jobs:
105108
with:
106109
node-version: '20'
107110

108-
- name: Install pnpm
109-
uses: pnpm/action-setup@v6
111+
- name: Enable Corepack
112+
run: corepack enable
113+
114+
- name: Verify pnpm version
115+
run: pnpm --version
110116

111117
- name: Get pnpm store directory
112118
shell: bash
@@ -117,9 +123,9 @@ jobs:
117123
uses: actions/cache@v5
118124
with:
119125
path: ${{ env.STORE_PATH }}
120-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
126+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
121127
restore-keys: |
122-
${{ runner.os }}-pnpm-store-v2-
128+
${{ runner.os }}-pnpm-store-v3-
123129
124130
- name: Install dependencies
125131
run: pnpm install --frozen-lockfile
@@ -168,8 +174,11 @@ jobs:
168174
with:
169175
node-version: '20'
170176

171-
- name: Install pnpm
172-
uses: pnpm/action-setup@v6
177+
- name: Enable Corepack
178+
run: corepack enable
179+
180+
- name: Verify pnpm version
181+
run: pnpm --version
173182

174183
- name: Get pnpm store directory
175184
shell: bash
@@ -180,9 +189,9 @@ jobs:
180189
uses: actions/cache@v5
181190
with:
182191
path: ${{ env.STORE_PATH }}
183-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
192+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
184193
restore-keys: |
185-
${{ runner.os }}-pnpm-store-v2-
194+
${{ runner.os }}-pnpm-store-v3-
186195
187196
- name: Setup Next.js cache
188197
uses: actions/cache@v5

.github/workflows/lint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
with:
2525
node-version: '20'
2626

27-
- name: Install pnpm
28-
uses: pnpm/action-setup@v6
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
- name: Verify pnpm version
31+
run: pnpm --version
2932

3033
- name: Get pnpm store directory
3134
shell: bash
@@ -36,9 +39,9 @@ jobs:
3639
uses: actions/cache@v5
3740
with:
3841
path: ${{ env.STORE_PATH }}
39-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
4043
restore-keys: |
41-
${{ runner.os }}-pnpm-store-v2-
44+
${{ runner.os }}-pnpm-store-v3-
4245
4346
- name: Install dependencies
4447
run: pnpm install --frozen-lockfile

.github/workflows/pr-automation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
with:
6666
node-version: '20'
6767

68-
- name: Install pnpm
69-
uses: pnpm/action-setup@v6
68+
- name: Enable Corepack
69+
run: corepack enable
7070

7171
- name: Install dependencies
7272
run: pnpm install --frozen-lockfile

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
with:
2424
node-version: '20'
2525

26-
- name: Install pnpm
27-
uses: pnpm/action-setup@v6
26+
- name: Enable Corepack
27+
run: corepack enable
28+
29+
- name: Verify pnpm version
30+
run: pnpm --version
2831

2932
- name: Get pnpm store directory
3033
shell: bash
@@ -35,9 +38,9 @@ jobs:
3538
uses: actions/cache@v5
3639
with:
3740
path: ${{ env.STORE_PATH }}
38-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
3942
restore-keys: |
40-
${{ runner.os }}-pnpm-store-v2-
43+
${{ runner.os }}-pnpm-store-v3-
4144
4245
- name: Install dependencies
4346
run: pnpm install --frozen-lockfile

.github/workflows/validate-deps.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ jobs:
2727
with:
2828
node-version: '20'
2929

30-
- name: Install pnpm
31-
uses: pnpm/action-setup@v6
30+
- name: Enable Corepack
31+
run: corepack enable
32+
33+
- name: Verify pnpm version
34+
run: pnpm --version
3235

3336
- name: Get pnpm store directory
3437
shell: bash
@@ -39,9 +42,9 @@ jobs:
3942
uses: actions/cache@v5
4043
with:
4144
path: ${{ env.STORE_PATH }}
42-
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
45+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
4346
restore-keys: |
44-
${{ runner.os }}-pnpm-store-v2-
47+
${{ runner.os }}-pnpm-store-v3-
4548
4649
- name: Verify lockfile is up to date
4750
run: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Fixed
11+
- **CI: Replace `pnpm/action-setup@v6` with corepack** — Switched all GitHub Actions workflows (`ci.yml`, `lint.yml`, `release.yml`, `validate-deps.yml`, `pr-automation.yml`) from `pnpm/action-setup@v6` to `corepack enable` to fix persistent `ERR_PNPM_BROKEN_LOCKFILE` errors. Corepack reads the exact `packageManager` field from `package.json` (including SHA verification), ensuring the correct pnpm version is used in CI. Also bumped pnpm store cache keys to v3 and added a pnpm version verification step.
1112
- **Broken pnpm lockfile** — Regenerated `pnpm-lock.yaml` from scratch to fix `ERR_PNPM_BROKEN_LOCKFILE` ("expected a single document in the stream, but found more") that was causing all CI jobs to fail. The previous merge of PR #1117 only included workflow cache key changes but did not carry over the regenerated lockfile.
1213

1314
### Added

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)