Skip to content

Commit a2852cc

Browse files
authored
fix: resolve npm --no-workspaces and --workspace conflict in bump-version CI (#37)
Run npm install --package-lock-only in a temp directory outside the monorepo so npm cannot detect workspace membership or traverse the root .npmrc (workspaces=false). This avoids the conflict between the implicit --no-workspaces flag set by root .npmrc and the --workspace flag that npm v9/v10 auto-sets when the CWD is inside a workspace member directory. Copies the existing package-lock.json into the temp dir first so npm makes incremental changes rather than regenerating from scratch.
1 parent 8979b3e commit a2852cc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/bump-version.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,15 @@ jobs:
7676
node-version: "20"
7777

7878
- name: Update client package-lock.json
79-
working-directory: apps/reasondb-client
80-
run: npm install --package-lock-only --ignore-scripts
79+
run: |
80+
PKGDIR="${RUNNER_TEMP}/npm-lockonly"
81+
mkdir -p "$PKGDIR"
82+
cp apps/reasondb-client/package.json "$PKGDIR/"
83+
if [ -f apps/reasondb-client/package-lock.json ]; then
84+
cp apps/reasondb-client/package-lock.json "$PKGDIR/"
85+
fi
86+
npm install --package-lock-only --ignore-scripts --prefix "$PKGDIR"
87+
cp "$PKGDIR/package-lock.json" apps/reasondb-client/package-lock.json
8188
8289
- name: Install Rust stable (for Cargo.lock update)
8390
uses: dtolnay/rust-toolchain@stable

0 commit comments

Comments
 (0)