Skip to content

Commit 5cd2aef

Browse files
ci: Strip color from release version check (#6513)
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 209d7cd commit 5cd2aef

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/build_wheels.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@ jobs:
191191
VERSION_WITHOUT_PREFIX: ${{ steps.get-version.outputs.version_without_prefix }}
192192
run: |
193193
feast version
194-
if ! VERSION_OUTPUT=$(feast version); then
195-
echo "Error: Failed to get Feast version."
196-
exit 1
197-
fi
198-
VERSION_REGEX='[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?'
199-
OUTPUT_REGEX="^Feast SDK Version: \"${VERSION_REGEX}\"$"
194+
if ! VERSION_OUTPUT=$(feast version); then
195+
echo "Error: Failed to get Feast version."
196+
exit 1
197+
fi
198+
VERSION_OUTPUT=$(printf '%s\n' "$VERSION_OUTPUT" | python -c 'import re, sys; print(re.sub(r"\x1b\[[0-9;]*[A-Za-z]", "", sys.stdin.read()).strip())')
199+
VERSION_REGEX='[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?'
200+
OUTPUT_REGEX="^Feast SDK Version: \"${VERSION_REGEX}\"$"
200201
VERSION=$(echo "$VERSION_OUTPUT" | grep -oE "$VERSION_REGEX")
201202
OUTPUT=$(echo "$VERSION_OUTPUT" | grep -E "$OUTPUT_REGEX")
202203
echo "Installed Feast Version: $VERSION and using Feast Version: $VERSION_WITHOUT_PREFIX"

0 commit comments

Comments
 (0)