Commit 50f20fb
committed
ci: skip PHPCS step when a PR changes no PHP files
The PHPCS inspection builds a list of changed `.php` files and passes
them to `phpcs`. When a PR touches no PHP files (e.g. a readme-only
change), that list is empty and `phpcs` runs with no file arguments,
falling back to the `<file>.</file>` directive in `phpcs.xml` and
scanning the entire repository -- failing on pre-existing violations
unrelated to the PR.
Guard the step with `if: steps.changes.outputs.files != ''` so it is
skipped when there are no PHP files to inspect.1 parent 644fe87 commit 50f20fb
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
0 commit comments