diff --git a/.github/actions/get-changed-files/get-changed-files.sh b/.github/actions/get-changed-files/get-changed-files.sh index c9e25549f1..a2f49f8b0d 100755 --- a/.github/actions/get-changed-files/get-changed-files.sh +++ b/.github/actions/get-changed-files/get-changed-files.sh @@ -18,8 +18,9 @@ git fetch --depth=1 origin main git fetch --depth=1 origin ${INPUT_HEAD:-HEAD} # Get diff with status information +# Find the merge-base (common ancestor) instead of using origin/main directly echo "__ running git diff with status __" -DIFF_OUTPUT=$(git diff --name-status origin/main origin/${INPUT_HEAD:-HEAD}) +DIFF_OUTPUT=$(git diff --name-status origin/main...origin/${INPUT_HEAD:-HEAD}) # Function to extract files by pattern from diff output extract_files() {