From 224f67faa24f560e1f99640edf19675dd5ee9679 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 12 Jan 2025 17:48:35 +1100 Subject: [PATCH] fix: ensure build.sh find correct changed files - ensure the build.sh script finds the changed files for the master branch or others --- ci/build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index 8e34e4d..f8be9e2 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,10 +1,13 @@ #!/bin/bash -# Check for changes in builds/ folder -builds_changes=$(git diff --name-only master | grep -E '^builds/') - -# Check for changes in images/ folder -images_changes=$(git diff --name-only master | grep -E '^images/') +# Check for changes in images/ folder and the builds/ folder +if [ "$(git branch --show-current)" = "master" ]; then + builds_changes=$(git diff --name-only HEAD^...master | grep -E '^builds/') + images_changes=$(git diff --name-only HEAD^...master | grep -E '^images/') +else + builds_changes=$(git diff --name-only master | grep -E '^builds/') + images_changes=$(git diff --name-only master | grep -E '^images/') +fi # Run `make all` if there are changes in builds/ if [ -n "$builds_changes" ]; then -- 2.47.3