Skip to content

Commit bb7ecc3

Browse files
authored
PMM-13881 Fix incorrect git describe behavior in Makefile (#1075)
Updated the COMPONENT_VERSION variable to use `--tags` flag with `git describe` to ensure proper tagging is captured. This ensures the build process correctly identifies version tags over lightweight commits.
1 parent 0918ed0 commit bb7ecc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GO_TEST_CODECOV ?=
88

99
BUILD ?= $(shell date +%FT%T%z)
1010
GOVERSION ?= $(shell go version | cut -d " " -f3)
11-
COMPONENT_VERSION ?= $(shell git describe --abbrev=0 --always)
11+
COMPONENT_VERSION ?= $(shell git describe --tags --abbrev=0 --always)
1212
COMPONENT_BRANCH ?= $(shell git describe --always --contains --all)
1313
PMM_RELEASE_FULLCOMMIT ?= $(shell git rev-parse HEAD)
1414
GO_BUILD_LDFLAGS = -X main.version=${COMPONENT_VERSION} -X main.buildDate=${BUILD} -X main.commit=${PMM_RELEASE_FULLCOMMIT} -X main.Branch=${COMPONENT_BRANCH} -X main.GoVersion=${GOVERSION} -s -w

0 commit comments

Comments
 (0)