-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7731af1
commit 129d97e
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Run phpcbf and capture output | ||
output=$(./vendor/bin/phpcbf "$@") | ||
exit_code=$? | ||
|
||
echo $output | ||
|
||
# Check if phpcbf made changes (non-zero exit code indicates fixes were made) | ||
if [ $exit_code -ne 0 ]; then | ||
echo "phpcbf made changes to the code." | ||
exit 1 | ||
else | ||
echo "No changes were made by phpcbf." | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: phpcbf check | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
phpcbf-check: | ||
runs-on: ubuntu-24.04 | ||
|
||
strategy: | ||
matrix: | ||
php-version: [ '8.1' ] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring, intl | ||
coverage: yes | ||
|
||
- name: php version | ||
run: php -v | ||
|
||
- name: Install Composer dependencies | ||
run: composer install | ||
|
||
- name: Run phpcbf | ||
run: bash "${GITHUB_WORKSPACE}/.github/run-phpcbf.sh" |