From 3b0859f4f4625f39c6f91f64fa91be5a3aa88c93 Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Wed, 22 Feb 2023 14:34:14 -0600 Subject: [PATCH] trim - from the end of branches (#25) * trim - from the end of branches --- util/metadata.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/metadata.sh b/util/metadata.sh index 22fb7f8..73607b2 100755 --- a/util/metadata.sh +++ b/util/metadata.sh @@ -120,7 +120,8 @@ EOF then cut_branch=$(echo "${normalized_branch}" | cut -c -${cutoff}) echo "Your branch name ${normalized_branch} + metadata exceeds the maximum length for K8s identifiers, truncating to ${cut_branch}" - normalized_branch="${cut_branch}" + # cut branch should not end in - trim any dashes from the end. + normalized_branch="${cut_branch%%*(-)}" fi echo "Before: '${branch}'"