Skip to content

Commit 3f608b2

Browse files
authored
Merge pull request #2243 from WordPress/feature/ghactions-fail-build-on-fixer-conflicts
GH Actions: fix fixer conflict check
2 parents a328aff + 700864c commit 3f608b2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/basic-qa.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,19 @@ jobs:
144144
# Test for fixer conflicts by running the auto-fixers of the complete WPCS over the test case files.
145145
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
146146
# If only fixable errors are found, the exit code will be 1, which can be interpreted as success.
147+
#
148+
# Note: the ValidVariableNameUnitTest.inc file is temporarily ignored until upstream PHPCS PR 3833 has been merged.
147149
- name: Test for fixer conflicts (fixes expected)
148150
if: ${{ matrix.phpcs_version == 'dev-master' }}
151+
id: phpcbf
149152
continue-on-error: true
150153
run: |
151-
$(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary
152-
if [ $? -eq 1 ]; then exit 0; fi
154+
set +e
155+
$(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary --ignore=/WordPress/Tests/NamingConventions/ValidVariableNameUnitTest.inc
156+
exitcode="$?"
157+
echo "EXITCODE=$exitcode" >> $GITHUB_OUTPUT
158+
exit "$exitcode"
159+
160+
- name: Fail the build on fixer conflicts and other errors
161+
if: ${{ steps.phpcbf.outputs.EXITCODE != 0 && steps.phpcbf.outputs.EXITCODE != 1 }}
162+
run: exit ${{ steps.phpcbf.outputs.EXITCODE }}

0 commit comments

Comments
 (0)