2023-10-20 07:38:08 -04:00
|
|
|
name: Pick an Azure region
|
|
|
|
description: "Pick an Azure region"
|
|
|
|
|
2024-01-26 09:22:14 -05:00
|
|
|
inputs:
|
|
|
|
attestationVariant:
|
|
|
|
description: "Attestation variant to use. Not all regions support all variants."
|
|
|
|
required: true
|
|
|
|
|
2023-10-20 07:38:08 -04:00
|
|
|
outputs:
|
|
|
|
region:
|
|
|
|
description: "One of the supported Azure regions"
|
|
|
|
value: ${{ steps.pick-region.outputs.region }}
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Pick a region
|
|
|
|
id: pick-region
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-01-26 09:22:14 -05:00
|
|
|
possibleRegionsSNP=(
|
2023-10-20 07:38:08 -04:00
|
|
|
"westus"
|
|
|
|
"eastus"
|
|
|
|
"northeurope"
|
|
|
|
"westeurope"
|
|
|
|
"southeastasia"
|
|
|
|
)
|
2024-01-26 09:22:14 -05:00
|
|
|
possibleRegionsTDX=(
|
|
|
|
"centralus"
|
|
|
|
"eastus2"
|
|
|
|
"northeurope"
|
|
|
|
"westeurope"
|
|
|
|
)
|
|
|
|
|
|
|
|
if [[ "${{ inputs.attestationVariant }}" == "azure-tdx" ]]; then
|
|
|
|
possibleRegions=("${possibleRegionsTDX[@]}")
|
|
|
|
else
|
|
|
|
possibleRegions=("${possibleRegionsSNP[@]}")
|
|
|
|
fi
|
|
|
|
|
2023-10-20 07:38:08 -04:00
|
|
|
region=${possibleRegions[$RANDOM % ${#possibleRegions[@]}]}
|
|
|
|
echo "region=$region" | tee -a "$GITHUB_OUTPUT"
|