From 19bc316cf67479d5902553aca825347184547f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 25 Feb 2025 15:56:44 +0100 Subject: [PATCH] Fix git tag support in queue.yml --- .github/workflows/queue.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/queue.yml b/.github/workflows/queue.yml index 07994bbb..2b7fd4d4 100644 --- a/.github/workflows/queue.yml +++ b/.github/workflows/queue.yml @@ -10,11 +10,19 @@ jobs: steps: - name: Prepare composer version constraint prefix run: | - BRANCH=${GITHUB_REF#refs/heads/} - if [[ $BRANCH =~ ^[0-9] ]]; then - echo "VERSION_PREFIX=${BRANCH}-dev" >> $GITHUB_ENV + if [[ $GITHUB_REF == refs/tags/* ]]; then + # For refs like "refs/tags/v3.9.0", remove "refs/tags/v" prefix to get just "3.9.0" + VERSION=${GITHUB_REF#refs/tags/v} + echo "VERSION_PREFIX=${VERSION}" >> $GITHUB_ENV else - echo "VERSION_PREFIX=dev-${BRANCH}" >> $GITHUB_ENV + BRANCH=${GITHUB_REF#refs/heads/} + if [[ $BRANCH =~ ^[0-9]\.x$ ]]; then + # Branches starting with %d.x need to use -dev suffix + echo "VERSION_PREFIX=${BRANCH}-dev" >> $GITHUB_ENV + else + # All other branches use dev-${branch} prefix + echo "VERSION_PREFIX=dev-${BRANCH}" >> $GITHUB_ENV + fi fi - name: Clone test suite