diff --git a/.github/workflows/tests-integration-reusable.yml b/.github/workflows/tests-integration-reusable.yml index 6ddcb98e5f7..241d1df7c1e 100644 --- a/.github/workflows/tests-integration-reusable.yml +++ b/.github/workflows/tests-integration-reusable.yml @@ -37,6 +37,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{inputs.gitRef}} + fetch-depth: 0 - name: Checkout CF deployment tasks uses: actions/checkout@v4 diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 42b59e6cee4..14a9ca2dfab 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -54,6 +54,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{needs.get-sha.outputs.gitRef}} + fetch-depth: 0 - name: Set Up Go uses: actions/setup-go@v5 with: diff --git a/Makefile b/Makefile index a62625cdb14..f0bbc5eaf57 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ NODES ?= 10 PACKAGES ?= api actor command types util version integration/helpers LC_ALL = "en_US.UTF-8" +CF_BUILD_VERSION ?= $$(git describe --tags --abbrev=0) CF_BUILD_SHA ?= $$(git rev-parse --short HEAD) CF_BUILD_DATE ?= $$(date -u +"%Y-%m-%d") LD_FLAGS_COMMON=-w -s \ diff --git a/version/version.go b/version/version.go index 47a77f878d5..4878c51b59a 100644 --- a/version/version.go +++ b/version/version.go @@ -1,6 +1,10 @@ package version -import "github.com/blang/semver/v4" +import ( + "strings" + + "github.com/blang/semver/v4" +) const DefaultVersion = "0.0.0-unknown-version" @@ -11,6 +15,8 @@ var ( ) func VersionString() string { + // Remove the "v" prefix from the binary in case it is present + binaryVersion = strings.TrimPrefix(binaryVersion, "v") versionString, err := semver.Make(binaryVersion) if err != nil { versionString = semver.MustParse(DefaultVersion)