mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
Find a way to bypass phpcbf exit code
This commit is contained in:
parent
7627ab74f1
commit
27aba531c6
17
.github/workflows/composer.yml
vendored
17
.github/workflows/composer.yml
vendored
|
@ -22,20 +22,15 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
# Bypass the phpcbf non-standard exit code
|
||||
- name: Run composer fix
|
||||
run: |
|
||||
./bin/phpcbf.sh
|
||||
composer fix
|
||||
|
||||
- name: Run Composer test
|
||||
run: composer test
|
||||
|
||||
- name: Attempt to auto fix the issues
|
||||
if: failure()
|
||||
run: composer fix
|
||||
|
||||
# Use failure() because phpcbf always return a failure
|
||||
- name: Re-run the auto fix and verify if the issues are resolved
|
||||
if: failure()
|
||||
run: |
|
||||
composer fix
|
||||
composer test
|
||||
|
||||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
|
||||
# Docs: https://getcomposer.org/doc/articles/scripts.md
|
||||
|
||||
|
|
15
bin/phpcbf.sh
Normal file
15
bin/phpcbf.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
# Wrap phpcbf to turn 1 success exit code into 0 code.
|
||||
# See https://github.com/squizlabs/PHP_CodeSniffer/issues/1818#issuecomment-354420927
|
||||
|
||||
root=$( dirname $0 )/..
|
||||
|
||||
$root/vendor/bin/phpcbf $@
|
||||
exit=$?
|
||||
|
||||
# Exit code 1 is used to indicate that all fixable errors were fixed correctly.
|
||||
if [[ $exit == 1 ]]; then
|
||||
exit=0
|
||||
fi
|
||||
|
||||
exit $exit
|
Loading…
Reference in a new issue