Skip to content

Commit 5e0ba98

Browse files
committed
fix(ci): handle missing lock file in CI workflows
1 parent 613f017 commit 5e0ba98

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
1315

1416
# -------- pnpm + cache ----------
1517
- uses: pnpm/action-setup@v4
@@ -20,17 +22,22 @@ jobs:
2022
node-version: 20
2123
cache: 'pnpm'
2224

23-
- run: pnpm install --frozen-lockfile
25+
# Try with --frozen-lockfile first, fallback to regular install if it fails
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile || pnpm install
28+
2429
- run: pnpm run lint
2530

2631
build:
2732
needs: lint
2833
runs-on: ubuntu-latest
2934
strategy:
3035
matrix:
31-
node-version: [18.x, 20.x, 22.x] # stable Node versions
36+
node-version: [18.x, 20.x, 22.x]
3237
steps:
3338
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
3441

3542
# -------- pnpm + cache ----------
3643
- uses: pnpm/action-setup@v4
@@ -41,14 +48,19 @@ jobs:
4148
node-version: ${{ matrix.node-version }}
4249
cache: 'pnpm'
4350

44-
- run: pnpm install --frozen-lockfile
51+
# Try with --frozen-lockfile first, fallback to regular install if it fails
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile || pnpm install
54+
4555
- run: pnpm run build
4656

4757
test:
4858
needs: build
4959
runs-on: ubuntu-latest
5060
steps:
5161
- uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
5264

5365
# -------- pnpm + cache ----------
5466
- uses: pnpm/action-setup@v4
@@ -59,5 +71,8 @@ jobs:
5971
node-version: 20
6072
cache: 'pnpm'
6173

62-
- run: pnpm install --frozen-lockfile
74+
# Try with --frozen-lockfile first, fallback to regular install if it fails
75+
- name: Install dependencies
76+
run: pnpm install --frozen-lockfile || pnpm install
77+
6378
- run: pnpm run test

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ jobs:
3232
registry-url: 'https://registry.npmjs.org'
3333
provenance: true
3434

35-
- run: pnpm install --frozen-lockfile
35+
# Try with --frozen-lockfile first, fallback to regular install if it fails
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile || pnpm install
3638

3739
- run: pnpm run test
3840

0 commit comments

Comments
 (0)