mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-29 22:47:48 +01:00
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:
parent
98e435490d
commit
86e6c62cf1
1 changed files with 3 additions and 1 deletions
4
.github/workflows/detect-changes.sh
vendored
4
.github/workflows/detect-changes.sh
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue