From 618c7da34dd387ae6295c223e874989b814a3de3 Mon Sep 17 00:00:00 2001 From: sk593 Date: Tue, 16 Jul 2024 14:02:58 -0700 Subject: [PATCH] update validate bicep Signed-off-by: sk593 --- .github/scripts/validate_bicep.py | 5 +++++ .github/workflows/validate-bicep.yaml | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/scripts/validate_bicep.py b/.github/scripts/validate_bicep.py index fc57dfb4b..be1000433 100644 --- a/.github/scripts/validate_bicep.py +++ b/.github/scripts/validate_bicep.py @@ -46,6 +46,11 @@ def validate_file(f): stderr = result.stderr.decode("utf-8") exitcode = result.returncode + warning_prefix = "WARNING: The following experimental Bicep features" + if stderr.startswith(warning_prefix): + stderr = "" + exitcode = 0 + if exitcode != 0: failures.append(f) print(stderr, flush=True) diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 5c5b503bc..8d277801b 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -25,14 +25,14 @@ jobs: name: Validate Bicep Code runs-on: ubuntu-latest steps: - - name: Check out repo - uses: actions/checkout@v4 - - name: Parse release version and set environment variables - run: python ./.github/scripts/get_docs_version.py - - name: Download rad-bicep - run: | - oras pull ghcr.io/radius-project/radius/bicep/rad-bicep/linux-x64:latest - chmod +x rad-bicep - ./rad-bicep --version - - name: Verify Bicep files - run: python ./.github/scripts/validate_bicep.py + - name: Check out repo + uses: actions/checkout@v4 + - name: Setup and verify bicep CLI + run: | + curl -Lo rad-bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 + chmod +x ./rad-bicep + bicep --version + - name: Verify Bicep files + run: ./build/validate-bicep.sh + env: + BICEP_PATH: './rad-bicep'