FIX: Exclude deleted files from the PHPStan/Phan changed-files CI script
get_changed_php.sh listed every file the GitHub PR-files API reports, including ones with status "removed" — deleted files no longer exist on disk, so passing them to phpstan/phan made the CI job fail trying to analyse a missing path. Any PR deleting PHP files hits this, not specific to one branch; exposed here since this PR removes 79 files.
This commit is contained in:
parent
8b96cbf1ba
commit
e746e56126
1 changed files with 5 additions and 3 deletions
8
.github/scripts/get_changed_php.sh
vendored
8
.github/scripts/get_changed_php.sh
vendored
|
|
@ -62,13 +62,15 @@ while true; do
|
|||
|
||||
|
||||
# Filter for files ending with .php and add them to the list
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("^dev/") | not)) | .filename')
|
||||
# Deleted files (status "removed") are excluded: they no longer exist on disk, so
|
||||
# passing them to phpstan/phan would just fail trying to analyse a missing path.
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("^dev/") | not) and (.status != "removed")) | .filename')
|
||||
changed_php_files+=("${files[@]}")
|
||||
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("'"$phan_directory_list"'"))) | .filename' | grep -vP "$phan_exclude_file_regex")
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("'"$phan_directory_list"'")) and (.status != "removed")) | .filename' | grep -vP "$phan_exclude_file_regex")
|
||||
changed_phan_files+=("${files[@]}")
|
||||
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select(.filename | test("\\.lang$")) | .filename')
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.lang$")) and (.status != "removed")) | .filename')
|
||||
changed_lang_files+=("${files[@]}")
|
||||
|
||||
# Check if we have reached the last page (less than per_page results)
|
||||
|
|
|
|||
Loading…
Reference in a new issue