ci: fix jq usage in mshv-infra.yaml

Workflow runs fail in the "Get Location" step with:

jq: error (at <stdin>:9): string ("100") and number (0) cannot be added

Use tonumber to explicitly convert string to number instead of the "+ 0"
trick.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
This commit is contained in:
Anirudh Rayabharam
2026-04-11 06:13:18 +00:00
committed by Rob Bradford
parent b8a61da06a
commit 3a23e2f841

View File

@@ -94,7 +94,7 @@ jobs:
fi
remaining=$(az vm list-usage --location "$location" --query "[?name.value=='$family'] | [0]" -o json |
jq '.limit + 0 - .currentValue >= $ARGS.positional[0]' --jsonargs "$vcpu")
jq '(.limit | tonumber) - (.currentValue | tonumber) >= ($ARGS.positional[0] | tonumber)' --jsonargs "$vcpu")
if [[ "$remaining" = true ]]; then
echo "Sufficient quota found in $location"
echo "location=$location" >> "$GITHUB_OUTPUT"