fix(ci): extract version number from PR title

The workflow was using the full PR title (e.g., 'Release 3.2.1') as the
version string, causing Docker tags and release creation to fail.

Now extracts just the version number (X.Y.Z or X.Y.Z-suffix) from the
PR title, handling formats like 'Release 3.2.1', 'v3.2.1', or '3.2.1'.
This commit is contained in:
EstrellaXD
2026-01-27 10:59:21 +01:00
parent 418e2b443f
commit e0cca519b5

View File

@@ -98,7 +98,14 @@ jobs:
run: |
if [ '${{ github.event_name }}' == 'pull_request' ]; then
if [ ${{ github.event.pull_request.merged }} == true ]; then
echo "version=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
# Extract version from PR title (handles "Release X.Y.Z", "vX.Y.Z", or "X.Y.Z")
PR_TITLE="${{ github.event.pull_request.title }}"
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?' | head -1)
if [ -n "$VERSION" ]; then
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "version=$PR_TITLE" >> $GITHUB_OUTPUT
fi
fi
elif [[ ${{ github.event_name }} == 'push' && (${{ github.ref }} == *'alpha'* || ${{ github.ref }} == *'beta'*) ]]; then
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT