Skip to content

Commit

Permalink
update validate workflow
Browse files Browse the repository at this point in the history
Signed-off-by: sk593 <[email protected]>
  • Loading branch information
sk593 committed Aug 19, 2024
1 parent fad7c64 commit 0150e28
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/scripts/validate_bicep.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

files = []
failures = []
warnings = []

# Walk the directory tree and find all .bicep files
for root, _, filenames in os.walk("."):
Expand All @@ -46,12 +47,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) and "Error" not in stderr:
stderr = ""
exitcode = 0
if "Warning" in stderr:
warnings.append(f)
print(stderr, flush=True)

if exitcode != 0:
if exitcode != 0 or "Error" in stderr:
failures.append(f)
print(stderr, flush=True)

Expand All @@ -62,4 +62,7 @@ def validate_file(f):
for f in failures:
print(f"Failed: {f}", flush=True)

for f in warnings:
print(f"Warning: {f}", flush=True)

exit(len(failures))

0 comments on commit 0150e28

Please sign in to comment.