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.
This commit is contained in:
Deluan 2026-09-05 14:09:39 -04:00
commit 86e6c62cf1

View file

@ -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