From 01d7a24593da880123f0a50a7c3868467a58b4e0 Mon Sep 17 00:00:00 2001 From: Alex Wilkerson John Date: Wed, 1 Jul 2026 14:04:20 -0400 Subject: [PATCH] fix(ci): extract version from var Number in homebrew validation version.go changed Number from const to var (6b1ccad) so ldflags -X injection works, but the homebrew-validation workflow still parsed it with an awk pattern anchored to `const Number = `. The pattern stopped matching, version came back empty, and the step failed with "failed to extract codeguard version from internal/version/version.go". Widen the pattern to match both `const` and `var` declarations. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/homebrew-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/homebrew-validation.yml b/.github/workflows/homebrew-validation.yml index e46ca8b..d7c9de8 100644 --- a/.github/workflows/homebrew-validation.yml +++ b/.github/workflows/homebrew-validation.yml @@ -40,7 +40,7 @@ jobs: run: | set -euo pipefail - version="$(awk -F'"' '/^const Number = / { print $2; exit }' internal/version/version.go)" + version="$(awk -F'"' '/^(const|var) Number = / { print $2; exit }' internal/version/version.go)" archive_path="$RUNNER_TEMP/codeguard-src.tar.gz" tap_dir="$RUNNER_TEMP/homebrew-tap" formula_path="$RUNNER_TEMP/homebrew-tap/Formula/codeguard.rb"