Skip to content

Commit

Permalink
ci: skip build if Bicep file unchanged (#17)
Browse files Browse the repository at this point in the history
* ci: skip build if Bicep file unchanged

* chore: add whitespace to increase readability
  • Loading branch information
hknutsen authored Dec 20, 2024
1 parent 400f60f commit 1221516
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1221516

Please sign in to comment.