diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a490f7..ed5fb4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,22 @@ jobs: id: build shell: bash {0} # Required to check exit code run: | + git diff --exit-code "$BICEP_FILE_PATH" + exit_code="$?" + if [[ "$exit_code" == 0 ]]; then + echo "No changes made to Bicep file. Skipping build." + exit "$exit_code" + fi + az bicep build --file "$BICEP_FILE_PATH" --outfile "$OUTPUT_FILE_PATH" exit_code="$?" if [[ "$exit_code" != 0 ]]; then exit "$exit_code" fi + git diff --exit-code "$OUTPUT_FILE_PATH" exit_code="$?" + echo "exit-code=$exit_code" >> "$GITHUB_OUTPUT" - name: Push commit