From c178f897abda2203ac9146cd0bdb8bc363101bf6 Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sat, 25 Jul 2026 11:35:09 -0400 Subject: [PATCH] [repo] Fix octal-parsing crash in validate.sh version comparison Bash arithmetic treats zero-padded segments (e.g. 08, 09) as octal, which is invalid and aborts the script under set -e. Force base-10 with 10# so version bumps like 0.2.08 no longer fail CI (see PR #192). --- .github/scripts/validate/validate.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/validate/validate.sh b/.github/scripts/validate/validate.sh index 88a5baf..2dae7d4 100755 --- a/.github/scripts/validate/validate.sh +++ b/.github/scripts/validate/validate.sh @@ -63,11 +63,11 @@ version_greater_than() { local old_version=$2 IFS='.' read -r NEW_MAJOR NEW_MINOR NEW_PATCH <<< "$new_version" IFS='.' read -r OLD_MAJOR OLD_MINOR OLD_PATCH <<< "$old_version" - if (( NEW_MAJOR > OLD_MAJOR )); then return 0; fi - if (( NEW_MAJOR < OLD_MAJOR )); then return 1; fi - if (( NEW_MINOR > OLD_MINOR )); then return 0; fi - if (( NEW_MINOR < OLD_MINOR )); then return 1; fi - if (( NEW_PATCH > OLD_PATCH )); then return 0; fi + if (( 10#$NEW_MAJOR > 10#$OLD_MAJOR )); then return 0; fi + if (( 10#$NEW_MAJOR < 10#$OLD_MAJOR )); then return 1; fi + if (( 10#$NEW_MINOR > 10#$OLD_MINOR )); then return 0; fi + if (( 10#$NEW_MINOR < 10#$OLD_MINOR )); then return 1; fi + if (( 10#$NEW_PATCH > 10#$OLD_PATCH )); then return 0; fi return 1 }