Skip to content

Commit 89c901b

Browse files
committed
GH Actions: harden the workflow against PHPCS ruleset errors
If there is a ruleset error, the `cs2pr` action doesn't receive an `xml` report and exits with a `0` error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error). This changes the GH Actions workflow to allow for that situation and still fail the build in that case.
1 parent a829c57 commit 89c901b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/check-cs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
composer update --prefer-dist --no-suggest --no-progress --no-interaction
4141
4242
- name: Check Code Style
43+
id: phpcs
4344
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
4445

4546
- name: Show PHPCS results in PR
47+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
4648
run: cs2pr ./phpcs-report.xml

0 commit comments

Comments
 (0)