Skip to content

feat: add location parameter #12

feat: add location parameter

feat: add location parameter #12

Workflow file for this run

name: Build
on:
pull_request:
branches:
- main
jobs:
bicep-build:
name: Bicep Build
runs-on: ubuntu-latest
env:
BICEP_FILE_PATH: main.bicep
OUTPUT_FILE_PATH: azuredeploy.json
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ github.head_ref }} # Required to push commit to PR
- name: Build Bicep file
id: build
shell: bash {0} # Required to check exit code
run: |
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
if: steps.build.outputs.exit-code != 0
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add "$OUTPUT_FILE_PATH"
git commit -m "Build Bicep file"
git push