build: only match version tags for BUILD_SCM_VERSION (#23903)

PR Close #23903
This commit is contained in:
Greg Magolan 2018-05-14 09:33:30 -07:00 committed by Alex Rickabaugh
parent 67b8d57a8d
commit 66b2d78305
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ if [[ "$(git tag)" == "" ]]; then
echo ""
fi
BUILD_SCM_VERSION_RAW=$(git describe --abbrev=7 --tags HEAD)
# Only match the latest tag that is a version such as 6.0.0, 6.0.0-rc.5, etc...
# This will ignore non-version tags which would break unit tests expecting a valid version
# number in the package headers
BUILD_SCM_VERSION_RAW=$(git describe --match [0-9].[0-9].[0-9]* --abbrev=7 --tags HEAD)
# Find out if there are any uncommitted local changes
# TODO(i): is it ok to use "--untracked-files=no" to ignore untracked files since they should not affect anything?