Skip to content

Tag release version before go build - #56

Draft
mkocher wants to merge 1 commit into
mainfrom
tag-before-build
Draft

mkocher wants to merge 1 commit into
mainfrom
tag-before-build

Conversation

@mkocher

@mkocher mkocher commented Oct 17, 2026

Copy link
Copy Markdown
Member

Context

When Go compiles a binary using go build, it embeds version information into the binary (runtime/debug.BuildInfo). If the build runs on an untagged checkout, Go generates a pseudo-version (e.g. v0.0.423-0.20261010100236-d3939dbbc728). When SBOM generators (such as Syft) catalog the compiled binary in stemcells, Black Duck and other vulnerability scanners fail to map the pseudo-version accurately and report security data against outdated versions.

Changes

In ci/tasks/build.sh, create a local git tag v${semver#v} before running go build. This ensures Go embeds the exact release version into the binary without altering the git history or release flow.

Ensure the Go binary embeds the exact semantic release version
(runtime/debug.BuildInfo) rather than an untagged pseudo-version,
so SBOM generators and vulnerability scanners accurately map the release.

ai-assisted=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant