name: Check & fix styling

on: [push]

jobs:
    pint:
        runs-on: ubuntu-latest

        steps:
            - name: Checkout code
              uses: actions/checkout@v4
              with:
                  ref: ${{ github.head_ref }}

            - name: Setup PHP
              uses: shivammathur/setup-php@v2
              with:
                  php-version: 8.4

            - name: Install dependencies
              run: composer install --no-interaction --no-progress

            - name: Run Pint
              run: vendor/bin/pint

            - name: Commit changes
              uses: stefanzweifel/git-auto-commit-action@v5.2.0
              with:
                  commit_message: Fix styling
