Skip to content

Commit

Permalink
GH Actions: harden the workflow against PHPCS ruleset errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Dec 27, 2023
1 parent 576c5b7 commit 4bed1de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ jobs:

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
continue-on-error: true
id: phpcs
run: vendor/bin/phpcs -- --report-full --report-checkstyle=./phpcs-report.xml

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

0 comments on commit 4bed1de

Please sign in to comment.