Skip to content

Deploy Site failing: wrangler: not found in preCommands after #4102 #4861

Description

@waynesun09

Summary

Every Deploy Site run since PR #4102 merged (2026-07-14 17:18 UTC) has failed with:

/bin/sh: 1: wrangler: not found
##[error]Process failed with exit code 127

Both the production deploy and PR-preview jobs in .github/workflows/site-deploy.yml are affected.

Root cause

PR #4102's second commit (0f14ac0) changed preCommands in both cloudflare/wrangler-action steps from an explicit npx wrangler@<version> ... invocation to bare wrangler ..., based on qodo-code-review's "duplicated version pin" finding. The commit message states:

wrangler-action already installs the pinned version and rewrites any command starting with wrangler to npx wrangler ... (no version)

That's accurate for wrangler-action's execCommands() (pinned commit 9acf94a, v3.15.0) — but the rewrite only fires when the entire preCommands line starts with the literal string "wrangler":

const cmd = command.startsWith("wrangler")
    ? `${packageManager.exec} ${command}`
    : command;

Our preCommands are single compound shell lines (by design — see the comments above each step: preCommands runs each newline as a separate /bin/sh invocation, so the mktemp/write/wrangler/cleanup sequence must stay on one line to share the same temp file path):

set -eu; secrets_file="$(mktemp)"; ...; wrangler versions secret bulk "$secrets_file" ...; rm -f "$secrets_file"

This line starts with "set", not "wrangler", so wrangler-action's rewrite never triggers, and bare wrangler runs with nothing on $PATH to resolve it. This was true regardless of dependency versions — the "duplicate pin" fix broke deploys by relying on a mechanism that structurally cannot apply to this workflow's compound-line pattern.

Fix

Restore explicit npx wrangler@4.110.0 inside both compound preCommands lines in .github/workflows/site-deploy.yml (production deploy step and PR-preview step), matching the file's pre-#4102 pattern but with the updated version.

Impact

All production deploys and PR preview deploys of the site are currently broken (since 2026-07-14 17:18 UTC).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcomponent/ciCI pipelines and checkspriority/criticalProduction outages or data lossready-to-codeTriggers code agent dispatchtype/bugConfirmed defect in existing behavior

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions