Add check-version.sh script

This commit is contained in:
2025-09-09 11:09:35 +03:00
parent 971cd45d06
commit 83e18f2832
+2 -5
View File
@@ -6,10 +6,7 @@ REPO="alsa-project/alsa-plugins"
# Get tag name using Github Rest API # Get tag name using Github Rest API
TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[0].name') TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[0].name')
# Get version number from tag name # Trim 'v' character in TAG_NAME variable
VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev) VERSION=$(echo "$TAG_NAME" | tr -d 'v')
# Trim 'v' character in VERSION variable
VERSION=$(echo "$VERSION" | tr -d 'v')
echo "$VERSION" echo "$VERSION"