Skip to content

Commit c3f1647

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 b0c727e commit c3f1647

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
@@ -41,8 +41,9 @@ jobs:
4141

4242
# Check the code-style consistency of the PHP files.
4343
- name: Check PHP code style
44-
continue-on-error: true
44+
id: phpcs
4545
run: composer check-cs -- --report-full --report-checkstyle=./phpcs-report.xml
4646

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

0 commit comments

Comments
 (0)