From 08913ba2bc26bc0e40baa27ffc10cb7367e9c695 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 22 May 2023 18:25:16 +0200 Subject: [PATCH] GH Actions: fix fixer conflict check While checking something else, I came across a notice in the GH Actions logs showing that the fixer conflict check was failing. Some backtracing shows that it has been failing for the past five months since PR 2132 was merged - see: https://github.com/WordPress/WordPress-Coding-Standards/actions/runs/3643130487 Unfortunately, the way the script was set up, this failure was not showing and not failing the builds. The changes I'm proposing now will fix that. I've also made sure that once the current fixer conflicts are fixed, the build will properly succeed again: https://github.com/jrfnl/WordPress-Coding-Standards/actions/runs/5048089688/jobs/9055836148 Next up: fix the fixer conflicts and whatever other errors have crept in since the build originally started failing.... --- .github/workflows/basic-qa.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/basic-qa.yml b/.github/workflows/basic-qa.yml index eb3cc03eb6..3b28f48f5c 100644 --- a/.github/workflows/basic-qa.yml +++ b/.github/workflows/basic-qa.yml @@ -146,7 +146,15 @@ jobs: # If only fixable errors are found, the exit code will be 1, which can be interpreted as success. - name: Test for fixer conflicts (fixes expected) if: ${{ matrix.phpcs_version == 'dev-master' }} + id: phpcbf continue-on-error: true run: | + set +e $(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary - if [ $? -eq 1 ]; then exit 0; fi + exitcode="$?" + echo "EXITCODE=$exitcode" >> $GITHUB_OUTPUT + exit "$exitcode" + + - name: Fail the build on fixer conflicts and other errors + if: ${{ steps.phpcbf.outputs.EXITCODE != 0 && steps.phpcbf.outputs.EXITCODE != 1 }} + run: exit ${{ steps.phpcbf.outputs.EXITCODE }}