From ffd8c880c502626f901ca05263c83a231067f185 Mon Sep 17 00:00:00 2001 From: Henrik Simonsen Knutsen <46495473+hknutsen@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:11:32 +0100 Subject: [PATCH] ci: fetch all refs --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 820d491..d5076e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +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 branches + 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 fetch origin "$GITHUB_BASE_REF" - git diff --exit-code --merge-base "origin/$GITHUB_BASE_REF" "$BICEP_FILE_PATH" + git diff --exit-code --merge-base "$GITHUB_BASE_REF" "$BICEP_FILE_PATH" exit_code="$?" if [[ "$exit_code" == 0 ]]; then echo "No changes made to Bicep file. Skipping build."