Skip to content

Fix: Gracefully handle cache drivers that do not support tagging #83

Fix: Gracefully handle cache drivers that do not support tagging

Fix: Gracefully handle cache drivers that do not support tagging #83

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