From 16c2bbb540ddbae6f9717797e41641cc24d223d0 Mon Sep 17 00:00:00 2001 From: xingzhou Date: Thu, 16 Jul 2026 22:49:07 +0800 Subject: [PATCH] fix(mantis): bound Crabbox source checkout (#108940) --- .../mantis-discord-status-reactions.yml | 2 +- .../mantis-discord-thread-attachment.yml | 2 +- .../workflows/mantis-slack-desktop-smoke.yml | 2 +- .../workflows/mantis-telegram-desktop-proof.yml | 2 +- .github/workflows/mantis-telegram-live.yml | 2 +- .../scripts/package-acceptance-workflow.test.ts | 17 +++++++++++++++++ 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mantis-discord-status-reactions.yml b/.github/workflows/mantis-discord-status-reactions.yml index 226ae827bc3e..61e6365bdbb4 100644 --- a/.github/workflows/mantis-discord-status-reactions.yml +++ b/.github/workflows/mantis-discord-status-reactions.yml @@ -271,7 +271,7 @@ jobs: set -euo pipefail install_dir="${RUNNER_TEMP}/crabbox" mkdir -p "$install_dir" "$HOME/.local/bin" - git clone --depth 1 https://github.com/openclaw/crabbox.git "$install_dir/src" + timeout --signal=TERM --kill-after=10s 120s git clone --depth 1 https://github.com/openclaw/crabbox.git "$install_dir/src" go build -C "$install_dir/src" -o "$HOME/.local/bin/crabbox" ./cmd/crabbox echo "$HOME/.local/bin" >> "$GITHUB_PATH" "$HOME/.local/bin/crabbox" --version diff --git a/.github/workflows/mantis-discord-thread-attachment.yml b/.github/workflows/mantis-discord-thread-attachment.yml index a96be15106c9..22b136cec39b 100644 --- a/.github/workflows/mantis-discord-thread-attachment.yml +++ b/.github/workflows/mantis-discord-thread-attachment.yml @@ -261,7 +261,7 @@ jobs: set -euo pipefail install_dir="${RUNNER_TEMP}/crabbox" mkdir -p "$install_dir" "$HOME/.local/bin" - git clone --depth 1 https://github.com/openclaw/crabbox.git "$install_dir/src" + timeout --signal=TERM --kill-after=10s 120s git clone --depth 1 https://github.com/openclaw/crabbox.git "$install_dir/src" go build -C "$install_dir/src" -o "$HOME/.local/bin/crabbox" ./cmd/crabbox echo "$HOME/.local/bin" >> "$GITHUB_PATH" "$HOME/.local/bin/crabbox" --version diff --git a/.github/workflows/mantis-slack-desktop-smoke.yml b/.github/workflows/mantis-slack-desktop-smoke.yml index 59d966c1a304..2e22eccfda07 100644 --- a/.github/workflows/mantis-slack-desktop-smoke.yml +++ b/.github/workflows/mantis-slack-desktop-smoke.yml @@ -203,7 +203,7 @@ jobs: mkdir -p "$install_dir" "$HOME/.local/bin" git init "$install_dir/src" git -C "$install_dir/src" remote add origin https://github.com/openclaw/crabbox.git - git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" + timeout --signal=TERM --kill-after=10s 120s git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" git -C "$install_dir/src" checkout --detach FETCH_HEAD go build -C "$install_dir/src" -o "$HOME/.local/bin/crabbox" ./cmd/crabbox echo "$HOME/.local/bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/mantis-telegram-desktop-proof.yml b/.github/workflows/mantis-telegram-desktop-proof.yml index 4108a311c5cd..0f464cd3d173 100644 --- a/.github/workflows/mantis-telegram-desktop-proof.yml +++ b/.github/workflows/mantis-telegram-desktop-proof.yml @@ -375,7 +375,7 @@ jobs: mkdir -p "$install_dir/src" git init "$install_dir/src" git -C "$install_dir/src" remote add origin https://github.com/openclaw/crabbox.git - git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" + timeout --signal=TERM --kill-after=10s 120s git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" git -C "$install_dir/src" checkout --detach FETCH_HEAD go build -C "$install_dir/src" -o "$install_dir/crabbox" ./cmd/crabbox sudo install -m 0755 "$install_dir/crabbox" /usr/local/bin/crabbox diff --git a/.github/workflows/mantis-telegram-live.yml b/.github/workflows/mantis-telegram-live.yml index eeef9904d7d5..5905f3ecc164 100644 --- a/.github/workflows/mantis-telegram-live.yml +++ b/.github/workflows/mantis-telegram-live.yml @@ -350,7 +350,7 @@ jobs: mkdir -p "$install_dir/src" "$HOME/.local/bin" git init "$install_dir/src" git -C "$install_dir/src" remote add origin https://github.com/openclaw/crabbox.git - git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" + timeout --signal=TERM --kill-after=10s 120s git -C "$install_dir/src" fetch --depth 1 origin "$CRABBOX_REF" git -C "$install_dir/src" checkout --detach FETCH_HEAD go build -C "$install_dir/src" -o "$HOME/.local/bin/crabbox" ./cmd/crabbox echo "$HOME/.local/bin" >> "$GITHUB_PATH" diff --git a/test/scripts/package-acceptance-workflow.test.ts b/test/scripts/package-acceptance-workflow.test.ts index 5cbfa4d372d4..65a10825bf21 100644 --- a/test/scripts/package-acceptance-workflow.test.ts +++ b/test/scripts/package-acceptance-workflow.test.ts @@ -2732,6 +2732,23 @@ describe("package artifact reuse", () => { } }); + it("bounds Mantis Crabbox source retrieval", () => { + const cases = [ + [MANTIS_DISCORD_STATUS_REACTIONS_WORKFLOW, "run_status_reactions"], + [MANTIS_DISCORD_THREAD_ATTACHMENT_WORKFLOW, "run_thread_attachment"], + [MANTIS_SLACK_DESKTOP_SMOKE_WORKFLOW, "run_slack_desktop"], + [MANTIS_TELEGRAM_DESKTOP_PROOF_WORKFLOW, "run_telegram_desktop_proof"], + [MANTIS_TELEGRAM_LIVE_WORKFLOW, "run_telegram_live"], + ] as const; + + for (const [workflowPath, jobName] of cases) { + const installStep = workflowStep(workflowJob(workflowPath, jobName), "Install Crabbox CLI"); + expect(installStep.run, workflowPath).toMatch( + /timeout --signal=TERM --kill-after=10s 120s git (?:clone|-C .* fetch)/u, + ); + } + }); + it("maps every supported Slack approval checkpoint scenario family", () => { const workflow = readFileSync(MANTIS_SLACK_DESKTOP_SMOKE_WORKFLOW, "utf8");