diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e858168..9a123f4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,33 @@ -# .github/workflows/lint.yml +name: fix-style -on: [push, pull_request] +on: + push: + pull_request: + paths: + - "**.php" jobs: php-cs-fixer: - name: PHP-CS-Fixer runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga + - name: Checkout Code + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv + + - name: Install Dependencies + run: composer install --prefer-dist + + - name: Fix Style + run: ./vendor/bin/php-cs-fixer fix --diff --allow-risky=yes + + - name: Commit Changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling changes