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 Oct 23, 2022
1 parent b0c727e commit c3f1647
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 @@ -41,8 +41,9 @@ jobs:

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
continue-on-error: true
id: phpcs
run: composer check-cs -- --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 c3f1647

Please sign in to comment.