Skip to content

Commit cc09853

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 640ffc1 commit cc09853

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/cs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ jobs:
8282

8383
# Check the code-style consistency of the PHP files.
8484
- name: Check PHP code style
85-
continue-on-error: true
85+
id: phpcs
8686
run: composer checkcs -- --report-full --report-checkstyle=./phpcs-report.xml
8787

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

0 commit comments

Comments
 (0)