Skip to content

Commit 8e758c2

Browse files
linuxdevelclaude
andcommitted
fix(ci): use npm --prefix to avoid cd breaking require.resolve
The previous cd into /tmp/sandbox-runtime caused the subsequent node require.resolve call to run in the wrong directory, unable to find @anthropic-ai/sandbox-runtime in safeclaw's node_modules. Use npm --prefix instead to keep cwd in GITHUB_WORKSPACE. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 79a3b3e commit 8e758c2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
- name: Build sandbox-runtime from source
3232
run: |
3333
git clone --depth 1 https://github.com/linuxdevel/sandbox-runtime /tmp/sandbox-runtime
34-
cd /tmp/sandbox-runtime && npm install && npm run build
34+
npm --prefix /tmp/sandbox-runtime install
35+
npm --prefix /tmp/sandbox-runtime run build
3536
SRT_DIR=$(node -e "console.log(require.resolve('@anthropic-ai/sandbox-runtime/package.json').replace('/package.json',''))")
3637
cp -r /tmp/sandbox-runtime/dist "$SRT_DIR/"
3738

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141
- name: Build sandbox-runtime from source
4242
run: |
4343
git clone --depth 1 https://github.com/linuxdevel/sandbox-runtime /tmp/sandbox-runtime
44-
cd /tmp/sandbox-runtime && npm install && npm run build
44+
npm --prefix /tmp/sandbox-runtime install
45+
npm --prefix /tmp/sandbox-runtime run build
4546
SRT_DIR=$(node -e "console.log(require.resolve('@anthropic-ai/sandbox-runtime/package.json').replace('/package.json',''))")
4647
cp -r /tmp/sandbox-runtime/dist "$SRT_DIR/"
4748

0 commit comments

Comments
 (0)