@@ -36,16 +36,26 @@ jobs:
3636 export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
3737 export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
3838 export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
39- export GPT_MIN_CAPACITY="150 "
39+ export GPT_MIN_CAPACITY="500 "
4040 export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
4141
4242 chmod +x infra/scripts/checkquota.sh
43- if ! infra/scripts/checkquota.sh; then
44- # If quota check fails due to insufficient quota, set the flag
45- if grep -q "No region with sufficient quota found" infra/scripts/checkquota.sh; then
43+
44+ # Capture the script output for analysis
45+ QUOTA_OUTPUT=$(infra/scripts/checkquota.sh 2>&1)
46+ QUOTA_EXIT_CODE=$?
47+
48+ echo "$QUOTA_OUTPUT"
49+
50+ if [ $QUOTA_EXIT_CODE -ne 0 ]; then
51+ # Check if the failure is due to insufficient quota
52+ if echo "$QUOTA_OUTPUT" | grep -q "No region with sufficient quota found"; then
4653 echo "QUOTA_FAILED=true" >> $GITHUB_ENV
54+ exit 0 # Don't fail the pipeline yet, let the notification step handle it
55+ else
56+ echo "QUOTA_FAILED=false" >> $GITHUB_ENV
57+ exit 1 # Fail for other errors
4758 fi
48- exit 1 # Fail the pipeline if any other failure occurs
4959 fi
5060
5161 - name : Send Notification on Quota Failure
6979
7080 - name : Set Deployment Region
7181 run : |
72- echo "Selected Region: $VALID_REGION"
73- echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
82+ if [ -n "$VALID_REGION" ]; then
83+ echo "Selected Region: $VALID_REGION"
84+ echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
85+ else
86+ echo "⚠️ Warning: No valid region was set by quota check"
87+ # This step should not run if quota check failed, but adding safety check
88+ exit 1
89+ fi
7490
7591 - name : Setup Azure CLI
7692 run : |
0 commit comments