Fix: Gracefully handle cache drivers that do not support tagging #83
Workflow file for this run
This file contains hidden or 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
| name: Code Style | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| pull_request: | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| jobs: | |
| fix: | |
| name: Auto-fix code style | |
| # Skip fork PRs — GITHUB_TOKEN can't push to external forks. | |
| # Fork contributors: run `composer rector && composer cs` locally. | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ github.token }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| coverage: none | |
| - name: Install composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Rector | |
| run: composer rector | |
| - name: PHP CS Fixer | |
| run: composer cs | |
| - name: Commit fixes | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: 'style: auto-fix (rector + php-cs-fixer)' | |
| commit_author: 'GitHub Actions <actions@github.com>' | |
| check: | |
| name: Verify code style (forks) | |
| # Only run the check job on fork PRs where we can't auto-fix. | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| coverage: none | |
| - name: Install composer dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Rector (dry-run) | |
| run: composer rector:dry | |
| - name: PHP CS check | |
| run: composer cs:check |