From c45c39ff48bfcbe0163bf6fddf683cfbcb73b654 Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Thu, 14 Nov 2024 09:35:35 -0500 Subject: [PATCH] Make the release binaries version detectable by Syft --- .github/workflows/binaries.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 445b04d..d97dd7f 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -74,6 +74,7 @@ jobs: options: > --volume ${{ github.workspace }}:/build --workdir /build + -e APIFIREWALL_NAMESPACE=github.com/wallarm/api-firewall run: |- set -e @@ -105,7 +106,7 @@ jobs: mkdir -p /tmp/api-firewall-${{ matrix.artifact }} && \ go mod download -x && \ go build \ - -ldflags="-X main.build=${{ env.X_TAG }} -extldflags=-static -s -w" \ + -ldflags="-X main.build=${{ env.X_TAG }} -X ${APIFIREWALL_NAMESPACE}/internal/version.Version=${{ env.X_TAG }} -extldflags=-static -s -w" \ -o /tmp/api-firewall-${{ matrix.artifact }}/api-firewall \ -buildvcs=false ./cmd/api-firewall && \ /tmp/api-firewall-${{ matrix.artifact }}/api-firewall -v && \