Skip to content

Commit 0f39455

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 c7c2aed commit 0f39455

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ jobs:
143143

144144
- name: 'PHPCS: check code style to show results in PR'
145145
if: ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
146-
continue-on-error: true
146+
id: phpcs
147147
run: php bin/phpcs --no-cache --parallel=1 --report-full --report-checkstyle=./phpcs-report.xml
148148

149149
- name: Show PHPCS results in PR
150-
if: ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
150+
if: ${{ always() && steps.phpcs.outcome == 'failure' && matrix.php == '7.4' }}
151151
run: cs2pr ./phpcs-report.xml
152152

153153
- name: Download the PHPCS phar

0 commit comments

Comments
 (0)