Skip to content

Commit ebfd02f

Browse files
fix v1
1 parent c31425c commit ebfd02f

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

.github/workflows/job-deploy.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,37 @@ jobs:
143143
144144
- name: Run Quota Check
145145
id: quota-check
146+
shell: pwsh
146147
run: |
147-
export AZURE_CLIENT_ID=${{ secrets.AZURE_CLIENT_ID }}
148-
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
149-
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
150-
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
151-
export GPT_MIN_CAPACITY=${{ env.GPT_MIN_CAPACITY }}
152-
export TEXT_EMBEDDING_MIN_CAPACITY=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }}
153-
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
148+
$ErrorActionPreference = "Stop" # Ensure that any error stops the pipeline
154149
155-
chmod +x scripts/checkquota.sh
156-
if ! scripts/checkquota.sh; then
157-
if grep -q "No region with sufficient quota found" scripts/checkquota.sh; then
158-
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
159-
fi
160-
exit 1
161-
fi
150+
# Path to the PowerShell script for quota check
151+
$quotaCheckScript = "Deployment/checkquota.ps1"
152+
153+
# Check if the script exists and is executable (not needed for PowerShell like chmod)
154+
if (-not (Test-Path $quotaCheckScript)) {
155+
Write-Host "❌ Error: Quota check script not found."
156+
exit 1
157+
}
158+
159+
# Run the script
160+
.\Deployment\checkquota.ps1
161+
162+
# If the script fails, check for the failure message
163+
$quotaFailedMessage = "No region with sufficient quota found"
164+
$output = Get-Content "Deployment/checkquota.ps1"
165+
166+
if ($output -contains $quotaFailedMessage) {
167+
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
168+
}
169+
env:
170+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
171+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
172+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
173+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
174+
GPT_MIN_CAPACITY: ${{ env.GPT_CAPACITY }}
175+
TEXT_EMBEDDING_MIN_CAPACITY: ${{ env.TEXT_EMBEDDING_CAPACITY }}
176+
AZURE_REGIONS: "${{ vars.AZURE_REGIONS }}"
162177

163178
- name: Set Quota Failure Output
164179
id: quota_failure_output

0 commit comments

Comments
 (0)