Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia committed Jun 20, 2024
1 parent cb0a3bb commit 2506c44
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/azure-login-positive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ jobs:
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
Expand All @@ -71,7 +69,7 @@ jobs:
az account show --output none
- name: Run Azure PowerShell again
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
Expand All @@ -94,13 +92,11 @@ jobs:
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
Expand Down Expand Up @@ -164,13 +160,11 @@ jobs:
az vm list --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = $checkResult -and ((Get-AzResourceGroup -Name GitHubAction_CI_RG).ResourceGroupName -eq 'GitHubAction_CI_RG')
$checkResult = $checkResult -and ((Get-AzVM).Count -gt 0)
if(-not $checkResult){
throw "Not all checks passed!"
}
Expand All @@ -189,7 +183,7 @@ jobs:
az account show --output none
- name: Run Azure PowerShell again
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
Expand All @@ -209,13 +203,13 @@ jobs:
- name: Run Azure Cli
shell: pwsh
run: |
$checkResult = (az account list --output json | ConvertFrom-Json).Count -eq 2
$checkResult = (az account list --output json | ConvertFrom-Json).Count -eq 3
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Run Azure PowerShell
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
Expand All @@ -236,11 +230,12 @@ jobs:
az account show --output none
- name: Run Azure PowerShell
uses: azure/powershell@v1
uses: azure/powershell@v2
with:
azPSVersion: "latest"
inlineScript: |
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
if(-not $checkResult){
throw "Not all checks passed!"
}

0 comments on commit 2506c44

Please sign in to comment.