diff --git a/scripts/build.sh b/scripts/build.sh index 191da8900..50bd57b4e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,7 +15,7 @@ GIT_COMMIT=$(git rev-parse HEAD) GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "-dev" || true) # Retrieve -VERSION=$(git describe --tags 2>/dev/null || git rev-parse --short HEAD) +VERSION=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || git rev-parse --short HEAD) # Inject version number LD_FLAGS="-X github.com/cloudskiff/driftctl/pkg/version.version=${VERSION}"