Skip to content

Commit 7e54856

Browse files
jrfnlgrogy
authored andcommitted
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 f363c40 commit 7e54856

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: .github/workflows/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ jobs:
3434
uses: ramsey/composer-install@v2
3535

3636
- name: Run code sniffer
37-
continue-on-error: true
37+
id: phpcs
3838
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
3939

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

4344
bundle:

0 commit comments

Comments
 (0)