Skip to content

Commit 76a17fc

Browse files
authored
Merge pull request #965 from EstrellaXD/3.2-dev
fix(ci): extract version number from PR title
2 parents 48d890a + e0cca51 commit 76a17fc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ jobs:
9898
run: |
9999
if [ '${{ github.event_name }}' == 'pull_request' ]; then
100100
if [ ${{ github.event.pull_request.merged }} == true ]; then
101-
echo "version=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
101+
# Extract version from PR title (handles "Release X.Y.Z", "vX.Y.Z", or "X.Y.Z")
102+
PR_TITLE="${{ github.event.pull_request.title }}"
103+
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?' | head -1)
104+
if [ -n "$VERSION" ]; then
105+
echo "version=$VERSION" >> $GITHUB_OUTPUT
106+
else
107+
echo "version=$PR_TITLE" >> $GITHUB_OUTPUT
108+
fi
102109
fi
103110
elif [[ ${{ github.event_name }} == 'push' && (${{ github.ref }} == *'alpha'* || ${{ github.ref }} == *'beta'*) ]]; then
104111
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)