From 17aa4e6bc18388d6c35a0c6db0f5519fdf98ef29 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 10 Jan 2026 16:44:30 +0200 Subject: [PATCH] Update check-version.sh script --- check-version.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/check-version.sh b/check-version.sh index 8a4c726..cc58809 100644 --- a/check-version.sh +++ b/check-version.sh @@ -1,13 +1,10 @@ #!/bin/bash -# Gitlab repository -REPO="libvirt/libvirt" +# Git repository +REPO="https://gitlab.com/libvirt/libvirt.git" -# Replace slash with URL encoded representation -REPO=$(echo "$REPO" | sed 's|/|%2F|g') - -# Get tag name using Gitlab Rest API -TAG_NAME=$(curl -s -L https://gitlab.com/api/v4/projects/"$REPO"/repository/tags | jq -r '.[].name' | grep '^v' | grep -v 'rc' | head -n1) +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | grep -E '^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$' | tail -n1) # Trim 'v' character in TAG_NAME variable VERSION=$(echo "$TAG_NAME" | tr -d 'v')