From b0542010a3965c516702f75fc5449a1d7c9257e0 Mon Sep 17 00:00:00 2001 From: Henrik Simonsen Knutsen <46495473+hknutsen@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:51:19 +0100 Subject: [PATCH] ci: fetch main branch before diff --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5c2384..81655fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,8 @@ jobs: id: build shell: bash {0} # Required to check exit code run: | - git diff --exit-code --merge-base "origin/$GITHUB_BASE_REF" "$BICEP_FILE_PATH" + git fetch origin "$GITHUB_BASE_REF" + 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."