Skip to content

Commit b4823bc

Browse files
committed
🐛 Fix version parsing in release workflow using cut instead of IFS
Replace IFS-based version string splitting with cut commands for parsing MAJOR, MINOR, and PATCH components. This approach is more reliable across different shell environments and avoids potential issues with word splitting. Add debug output to display parsed version components during workflow runs.
1 parent 01f7ce7 commit b4823bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ jobs:
7878
if [[ -n "${{ inputs.version }}" ]]; then
7979
VERSION="${{ inputs.version }}"
8080
else
81-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
81+
# Parse version components using cut (more reliable than IFS)
82+
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
83+
MINOR=$(echo "$CURRENT" | cut -d. -f2)
84+
PATCH=$(echo "$CURRENT" | cut -d. -f3)
85+
86+
echo "Parsed: MAJOR=$MAJOR MINOR=$MINOR PATCH=$PATCH"
87+
8288
case "${{ inputs.bump }}" in
8389
major) VERSION="$((MAJOR + 1)).0.0" ;;
8490
minor) VERSION="${MAJOR}.$((MINOR + 1)).0" ;;

0 commit comments

Comments
 (0)