From f17ee26e95e4d837c2da96bcb4730e2650c67bc1 Mon Sep 17 00:00:00 2001 From: Joey Zhao <5253430+joeyzhao2018@users.noreply.github.com> Date: Fri, 12 Sep 2025 11:29:43 -0400 Subject: [PATCH] fixing the version and make the release.sh script catch wrong format --- internal/version/version.go | 2 +- scripts/release.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/version/version.go b/internal/version/version.go index 873b6033..db323dfc 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -3,7 +3,7 @@ package version // DDLambdaVersion is the current version number of this library (datadog-lambda-go). // It is automatically updated by the release script. -const DDLambdaVersion = "v1.27.0" +const DDLambdaVersion = "1.27.0" // DDTraceVersion is the version of dd-trace-go required by this libary. // This should match the version number specified in go.mod. diff --git a/scripts/release.sh b/scripts/release.sh index 58b5f71f..c6bae70c 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -25,11 +25,16 @@ fi if [ -z "$1" ]; then echo "Must specify a desired version number" exit 1 -elif [[ ! $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - echo "Must use a semantic version, e.g., 3.1.4" - exit 1 else - NEW_VERSION=$1 + # Remove 'v' prefix if present + CLEAN_VERSION=${1#v} + + if [[ ! $CLEAN_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Must use a semantic version, e.g., 3.1.4" + exit 1 + else + NEW_VERSION=$CLEAN_VERSION + fi fi CURRENT_DD_TRACE_VERSION="$(grep "const DDTraceVersion" internal/version/version.go | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+")"