Skip to content

Commit 728b100

Browse files
committed
ci: Improve version extraction from dry run output in release workflow
Signed-off-by: Eden Reich <eden.reich@gmail.com>
1 parent d9925fa commit 728b100

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ jobs:
5151
exit 0
5252
fi
5353
54-
echo "new_release_version=$(echo $dry_run_output | grep -i 'published release' | awk '{print $8}')" >> $GITHUB_OUTPUT
54+
# Extract version from dry run output
55+
version=$(echo "$dry_run_output" | grep -o "The next release version is [0-9]\+\.[0-9]\+\.[0-9]\+" | cut -d ' ' -f6)
56+
if [ -z "$version" ]; then
57+
echo "Error: Could not determine version"
58+
exit 1
59+
fi
60+
61+
echo "new_release_version=$version" >> $GITHUB_OUTPUT
5562
semantic-release
5663
echo "new_release_published=true" >> $GITHUB_OUTPUT
5764
env:

0 commit comments

Comments
 (0)