From 3dfdca3993295b5c39e40f122127a509fe57b726 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Wed, 13 May 2026 04:31:32 +0000 Subject: [PATCH] fix(release): wrap goreleaser before-hooks in sh -c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v1.0.0 release run (workflow #25778329702) failed at the very first hook with: error=exec: "cd": executable file not found in $PATH cmd=cd Root cause: goreleaser's `before.hooks` runs each entry via Go's exec.Command — no shell interpretation. `cd go && go mod download` gets parsed as binary="cd", args=["go", " && ", "go", "mod", "download"], and exec can't find a `cd` binary. Fix: wrap each hook in `sh -c "…"` so the working-directory change and `&&` chain run inside a real shell. After this lands, retag v1.0.0 to re-fire the release workflow. Co-Authored-By: Claude Opus 4.7 (1M context) --- .goreleaser.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8381c236..777cf0e1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,9 +17,11 @@ env: before: hooks: # Sanity gate. Failing here aborts the release before any binary - # leaves the runner. - - cd go && go mod download - - cd go && go test ./... -count=1 + # leaves the runner. Goreleaser runs each hook via exec.Command + # (no shell), so bare `cd go && …` fails — `cd` isn't an executable + # in $PATH. Wrap in `sh -c` to get a working-directory side-effect. + - sh -c "cd go && go mod download" + - sh -c "cd go && go test ./... -count=1" builds: - id: codeiq