From 6c75b98a86c4b48ce392900ffbdef863f64240af Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 23 Oct 2022 12:00:14 +0200 Subject: [PATCH] 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. --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75f4252..f96e5f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,10 +34,11 @@ jobs: uses: ramsey/composer-install@v2 - name: Run code sniffer - 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 bundle: