From fb92430dd1245a26a835d2c87357cbfb32d54644 Mon Sep 17 00:00:00 2001 From: Marco Maatz Date: Sat, 19 Oct 2024 01:14:03 +0200 Subject: [PATCH] parse tag prefix --- .gitea/workflows/parseVersion.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/parseVersion.yaml b/.gitea/workflows/parseVersion.yaml index 4887e2c..f74b1c6 100644 --- a/.gitea/workflows/parseVersion.yaml +++ b/.gitea/workflows/parseVersion.yaml @@ -35,9 +35,20 @@ jobs: steps: - id: parseStep run: | - VERSION=$(echo ${{ inputs.version }} | sed 's|.*/||') + input="${{ inputs.version }}" + input="${VERSION#refs/tags/}" - IFS='.' read -r major minor patch build <<< "$VERSION" + if [[ "$input" == *"/"* ]]; then + prefix=$(echo "$input" | cut -d'/' -f1) + version=$(echo "$input" | cut -d'/' -f2) + else + prefix="beta" + version="$input" + fi + + version=$(echo ${{ inputs.version }} | sed 's|.*/||') + + IFS='.' read -r major minor patch build <<< "$version" if [ -z "$build" ]; then build="0"