Skip to content

Commit

Permalink
PES-2321: phpcbf pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-potuznik-z committed Nov 4, 2024
1 parent 7731af1 commit 129d97e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/run-phpcbf.sh
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
34 changes: 34 additions & 0 deletions .github/workflows/run-phpcbf.yml
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"

0 comments on commit 129d97e

Please sign in to comment.