From ea03043453702a4cce37fc6465d1265f93c3e13c Mon Sep 17 00:00:00 2001 From: kazuyan Date: Mon, 11 Dec 2023 09:09:37 +0900 Subject: [PATCH] =?UTF-8?q?5=E7=AB=A0=EF=BC=9ABicep=20what-if=20=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=81=AE=E8=BF=BD=E5=8A=A0=20(#93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add bicep what-if workflow * Add what-if step to Azure CLI workflow --- .github/workflows/5.what-if.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/5.what-if.yml diff --git a/.github/workflows/5.what-if.yml b/.github/workflows/5.what-if.yml new file mode 100644 index 0000000..f4c8fb8 --- /dev/null +++ b/.github/workflows/5.what-if.yml @@ -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 \ No newline at end of file