Skip to content

Commit 3dfdca3

Browse files
aksOpsclaude
andcommitted
fix(release): wrap goreleaser before-hooks in sh -c
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) <noreply@anthropic.com>
1 parent e21fe0f commit 3dfdca3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.goreleaser.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ env:
1717
before:
1818
hooks:
1919
# Sanity gate. Failing here aborts the release before any binary
20-
# leaves the runner.
21-
- cd go && go mod download
22-
- cd go && go test ./... -count=1
20+
# leaves the runner. Goreleaser runs each hook via exec.Command
21+
# (no shell), so bare `cd go && …` fails — `cd` isn't an executable
22+
# in $PATH. Wrap in `sh -c` to get a working-directory side-effect.
23+
- sh -c "cd go && go mod download"
24+
- sh -c "cd go && go test ./... -count=1"
2325

2426
builds:
2527
- id: codeiq

0 commit comments

Comments
 (0)