Skip to content

Commit 601e538

Browse files
author
Thierry RAMORASOAVINA
committed
Fix the versions check in the Pip workflow
- as the 'rev' is not installed by default on Windows 2025 runner (allegedly in 'linux-utils'), it seems simpler to change the check
1 parent fba9175 commit 601e538

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/pip.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,10 @@ jobs:
217217
if [[ "${{ matrix.env.use-virtualenv }}" == "true" ]]; then
218218
deactivate
219219
fi
220-
echo "${{ github.ref_name }}" | tr -d '-' | rev | sed -E 's/\.([^0-9].*)/\1/' | rev | \
221-
grep -wq "$PACKAGE_VERSION"
222-
if [[ $? -ne 0 ]]
220+
# Remove any '.' or '-' from the versions to be able to compare them canonically
221+
canonic_tag_name=$(echo "${{ github.ref_name }}" | perl -pe "s/[\.-]//g")
222+
canonic_package_version=$(echo $PACKAGE_VERSION | perl -pe "s/[\.-]//g")
223+
if [[ "$canonic_tag_name" != "$canonic_package_version" ]]
223224
then
224225
echo "::error::Python package version $PACKAGE_VERSION does not match Git tag ${{ github.ref_name }}"
225226
false

0 commit comments

Comments
 (0)