From 5cb96cf1a8bd18f3cdd8d19bc22dc930676e4919 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:37:16 +0000 Subject: [PATCH 1/2] Initial plan From c4caac744acb50f13de2913ca70af3414ad3ec4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:44:16 +0000 Subject: [PATCH 2/2] fix: use = syntax in go_build_options ldflags to avoid word-splitting The release workflow was passing `-ldflags '-X ...'` via `go_build_options`, which gets set as the `GO_BUILD_OPTIONS` environment variable. In `build_and_release.sh`, this variable is expanded unquoted (`${GO_BUILD_OPTIONS}`), so bash word-splits it on spaces. Single quotes inside an unquoted variable expansion are literal characters, not shell quotes - causing `'-X` (with the literal quote character) to be passed as the value for `-ldflags`, which is invalid. Fix: use `-ldflags=-X=path.Var=value` (no spaces, single token) so bash word splitting produces exactly one argument. The `=` syntax is supported by both the Go build tool (for `-ldflags`) and the Go linker (for `-X`). Co-authored-by: skarim <1701557+skarim@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-stack/sessions/7f8aece9-d05c-478e-8864-ff0b5e00b3a8 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f67c8b2..d53803d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,4 +22,4 @@ jobs: generate_attestations: true go_version_file: go.mod go_build_options: >- - -ldflags '-X github.com/github/gh-stack/cmd.Version=${{ steps.version.outputs.version }}' + -ldflags=-X=github.com/github/gh-stack/cmd.Version=${{ steps.version.outputs.version }}