diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed5fb4c..1dde4b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,13 +16,14 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: - ref: ${{ github.head_ref }} # Required to push commit to PR + fetch-depth: 0 # Required to show diff between PR source and target branch + ref: ${{ github.head_ref }} # Required to push commit to PR source branch - name: Build Bicep file id: build shell: bash {0} # Required to check exit code run: | - git diff --exit-code "$BICEP_FILE_PATH" + git diff --exit-code "origin/$GITHUB_BASE_REF" "$BICEP_FILE_PATH" exit_code="$?" if [[ "$exit_code" == 0 ]]; then echo "No changes made to Bicep file. Skipping build."