Skip to content

Commit 15f49eb

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 57c8551 commit 15f49eb

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
@@ -155,11 +155,11 @@ jobs:
155155

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

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

165165
- name: Download the PHPCS phar

0 commit comments

Comments
 (0)