mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: Use bash regex instead of sed
Easier to read and more reliable. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Bo Chen
parent
295a76ea28
commit
dcdf16b8ff
6
.github/workflows/mshv-infra.yaml
vendored
6
.github/workflows/mshv-infra.yaml
vendored
@@ -78,11 +78,11 @@ jobs:
|
||||
run: |
|
||||
set -eufo pipefail
|
||||
# Extract vCPU count from SKU (e.g., "Standard_D2s_v3" => 2)
|
||||
vcpu=$(echo "$SKU" | sed -n 's/^Standard_[A-Za-z]\+\([0-9]\+\).*/\1/p')
|
||||
if [[ -z "$vcpu" ]]; then
|
||||
echo "Cannot extract vCPU count from SKU: $SKU"
|
||||
if ! [[ "$SKU" =~ ^Standard_[A-Za-z]+([1-9][0-9]*) ]]; then
|
||||
printf 'Cannot extract vCPU count from SKU: %q\n' "$SKU"
|
||||
exit 1
|
||||
fi
|
||||
vcpu=${BASH_REMATCH[1]}
|
||||
|
||||
SUPPORTED_LOCATIONS=$(echo "$STORAGE_ACCOUNT_PATHS" | jq -r 'to_entries[] | .key')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user