Catch all the PHPCS errors only on changed files (https://github.com/woocommerce/woocommerce-blocks/pull/10402)

* Commit a php lint warning

* Add param to show php warnings

* Print exit code

* Test

* test 2

* Add back cs2pr

* Add checkstyle

* Remove exit code

* Test without report

* Add checkstyle

* Fix php

* Test changed files

* Print changed files

* Introduce error

* More errors

* Fix errors

* Test

* Test all cases

* Fix php lint errors

* Rename readme

* Show all files

* Test new action

* Test

* Try other actions

* Add errors

* Remove actions

* More errors

* Fix git diff

* Fix all php errors

* Remove git fetch

* Add error

* Fix error and action
This commit is contained in:
Alba Rincón 2023-08-01 10:25:12 +02:00 committed by GitHub
parent 720f65ca36
commit 2df75990e3
1 changed files with 5 additions and 2 deletions

View File

@ -60,5 +60,8 @@ jobs:
- name: Log PHPCS debug information
run: phpcs -i
- name: Run PHPCS on all files
run: phpcs ./src -n --report=checkstyle | cs2pr
- name: Run PHPCS on all changed files
run: |
git fetch origin trunk
changes=$(git diff --name-only origin/trunk..HEAD | tr '\n' ' ')
phpcs ${changes} -q --report=checkstyle | cs2pr