Skip to content

Commit

Permalink
5章:Bicep what-if チェックの追加 (#93)
Browse files Browse the repository at this point in the history
* Add bicep what-if workflow
* Add what-if step to Azure CLI workflow
  • Loading branch information
kazuki-komori authored Dec 11, 2023
1 parent 927aaaf commit ea03043
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/5.what-if.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: bicep what-if

on: push

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true

- name: what-if using Azure CLI
run: |
results=$(az deployment sub what-if --template-file "./5.internal-document-search/infra/main.bicep" --location JapanEast -p vmLoginPassword=dummy -p resourceGroupName=rg-${{ github.run_id }} -p isPrivateNetworkEnabled=false -p environmentName=${{ github.run_id }} -p location=japaneast)
echo "$results"
# Check if "Error" is present in $results
if echo "$results" | grep "Error"; then
echo "Error found in what-if results. Exiting..."
exit 1
fi

0 comments on commit ea03043

Please sign in to comment.