From 86e6c62cf186c50820b2ee181803f59d9fdf1a12 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 5 Sep 2026 14:09:39 -0400 Subject: [PATCH] ci: count the source path of a rename in change detection Rename detection makes `git diff --name-only` report only the destination, so moving a file out of a gated area dropped the source from every filter. A rename of ui/src/a.js to docs/a.js.md emitted all four flags as false, skipping the build for a change that deleted UI source. --no-renames turns the rename back into a delete plus an add, so both paths participate. It is also about 8x faster on a large diff, since rename detection is the expensive part, and it can only ever move a flag from false to true. --- .github/workflows/detect-changes.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/detect-changes.sh b/.github/workflows/detect-changes.sh index 3146abf66..138db4871 100755 --- a/.github/workflows/detect-changes.sh +++ b/.github/workflows/detect-changes.sh @@ -42,7 +42,9 @@ if ! git rev-parse --verify --quiet "origin/${BASE_REF}" >/dev/null; then exit 1 fi -files="$(git diff --name-only "origin/${BASE_REF}...HEAD")" +# --no-renames: rename detection reports only the destination, so moving a file +# out of a gated area would drop the source path from every filter. +files="$(git diff --no-renames --name-only "origin/${BASE_REF}...HEAD")" echo "Changed files:" printf '%s\n' "$files" | sed 's/^/ /' echo