Skip to content

Commit a1adfea

Browse files
committed
ci: fix pnpm github-dep clone on CI and drop redundant --frozen-lockfile
pnpm records GitHub git dependencies (node-addon-examples) with an SSH repo URL (git@github.com:...). Stock CI runners have no SSH key, so the clone fails. Add an ad-hoc git config via workflow-level env (GIT_CONFIG_COUNT/KEY_0/VALUE_0) that rewrites git@github.com: to https://github.com/, so the public repo is fetched anonymously over HTTPS in every job without a per-job step. Also drop the explicit `--frozen-lockfile` from `pnpm install`: pnpm enables it by default when the CI environment variable is set, so it was redundant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnwodAoNbqPec77191HVXn
1 parent f014b5e commit a1adfea

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

.github/workflows/check.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ env:
66
NDK_VERSION: 27.1.12297006
77
# Enabling the Gradle test on CI (disabled by default because it downloads a lot)
88
ENABLE_GRADLE_TESTS: true
9+
# pnpm records GitHub git dependencies (e.g. node-addon-examples) with an SSH
10+
# repo URL, which anonymous CI runners can't clone. Rewrite git@github.com: to
11+
# HTTPS so the public repo is fetched over HTTPS. Provided as ad-hoc git config
12+
# via env so it applies to every job without a per-job step.
13+
GIT_CONFIG_COUNT: 1
14+
GIT_CONFIG_KEY_0: "url.https://github.com/.insteadOf"
15+
GIT_CONFIG_VALUE_0: "git@github.com:"
916

1017
on:
1118
push:
@@ -49,7 +56,7 @@ jobs:
4956
with:
5057
packages: tools platform-tools ndk;${{ env.NDK_VERSION }}
5158
- run: rustup target add x86_64-linux-android
52-
- run: pnpm install --frozen-lockfile
59+
- run: pnpm install
5360
- run: pnpm run build
5461
# Bootstrap weak-node-api and ferric-example to get types
5562
# TODO: Solve this by adding an option to ferric to build only types or by committing the types into the repo as a fixture for an "init" command
@@ -102,7 +109,7 @@ jobs:
102109
uses: jwlawson/actions-setup-cmake@v2
103110
with:
104111
cmake-version: ${{ env.CMAKE_VERSION }}
105-
- run: pnpm install --frozen-lockfile
112+
- run: pnpm install
106113
- run: pnpm run bootstrap
107114
- run: pnpm test
108115
weak-node-api-tests:
@@ -137,7 +144,7 @@ jobs:
137144
uses: jwlawson/actions-setup-cmake@v2
138145
with:
139146
cmake-version: ${{ env.CMAKE_VERSION }}
140-
- run: pnpm install --frozen-lockfile
147+
- run: pnpm install
141148
- run: pnpm run build
142149
- name: Prepare weak-node-api
143150
run: pnpm --filter weak-node-api run prebuild:prepare
@@ -181,7 +188,7 @@ jobs:
181188
uses: jwlawson/actions-setup-cmake@v2
182189
with:
183190
cmake-version: ${{ env.CMAKE_VERSION }}
184-
- run: pnpm install --frozen-lockfile
191+
- run: pnpm install
185192
- run: pnpm run bootstrap
186193
env:
187194
CMAKE_RN_TRIPLETS: arm64;x86_64-apple-ios-sim
@@ -224,7 +231,7 @@ jobs:
224231
with:
225232
cmake-version: ${{ env.CMAKE_VERSION }}
226233
- run: rustup target add x86_64-apple-darwin
227-
- run: pnpm install --frozen-lockfile
234+
- run: pnpm install
228235
- run: pnpm run bootstrap
229236
env:
230237
CMAKE_RN_TRIPLETS: arm64;x86_64-apple-darwin
@@ -272,7 +279,7 @@ jobs:
272279
with:
273280
packages: tools platform-tools ndk;${{ env.NDK_VERSION }} cmake;${{ env.CMAKE_VERSION }}
274281
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
275-
- run: pnpm install --frozen-lockfile
282+
- run: pnpm install
276283
- run: pnpm run bootstrap
277284
env:
278285
CMAKE_RN_TRIPLETS: x86_64-linux-android
@@ -364,7 +371,7 @@ jobs:
364371
uses: jwlawson/actions-setup-cmake@v2
365372
with:
366373
cmake-version: ${{ env.CMAKE_VERSION }}
367-
- run: pnpm install --frozen-lockfile
374+
- run: pnpm install
368375
- run: pnpm run build
369376
- name: Build weak-node-api for all Apple architectures
370377
run: |

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Release
33
env:
44
# Version here should match the one in React Native template and packages/cmake-rn/src/cli.ts
55
NDK_VERSION: 27.1.12297006
6+
# pnpm records GitHub git dependencies (e.g. node-addon-examples) with an SSH
7+
# repo URL, which anonymous CI runners can't clone. Rewrite git@github.com: to
8+
# HTTPS so the public repo is fetched over HTTPS.
9+
GIT_CONFIG_COUNT: 1
10+
GIT_CONFIG_KEY_0: "url.https://github.com/.insteadOf"
11+
GIT_CONFIG_VALUE_0: "git@github.com:"
612

713
on:
814
push:

0 commit comments

Comments
 (0)