From e3af8ad2876d5cb9122d127b0bd471182a769e36 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 2 Mar 2026 09:16:25 +0100 Subject: [PATCH] Only strip v for digit tags; sanitize version Improve GitHub release tag handling: only remove a leading 'v' when it's followed by a digit (avoids mangling tags like "version/..."), and sanitize the derived version string for filenames by replacing '/' with '-'. Use the sanitized version when constructing the downloaded tarball filename to prevent invalid or unexpected paths. --- misc/tools.func | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index f16d619b9..84f5e053b 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2195,7 +2195,12 @@ check_for_gh_release() { local clean_tags=() for t in "${raw_tags[@]}"; do - clean_tags+=("${t#v}") + # Only strip leading 'v' when followed by a digit (e.g. v1.2.3) + if [[ "$t" =~ ^v[0-9] ]]; then + clean_tags+=("${t:1}") + else + clean_tags+=("$t") + fi done local latest_raw="${raw_tags[0]}" @@ -2308,7 +2313,12 @@ check_for_codeberg_release() { local clean_tags=() for t in "${raw_tags[@]}"; do - clean_tags+=("${t#v}") + # Only strip leading 'v' when followed by a digit (e.g. v1.2.3) + if [[ "$t" =~ ^v[0-9] ]]; then + clean_tags+=("${t:1}") + else + clean_tags+=("$t") + fi done local latest_raw="${raw_tags[0]}" @@ -3138,7 +3148,10 @@ function fetch_and_deploy_gh_release() { local json tag_name json=$(