Skip to content

Instantly share code, notes, and snippets.

@stevebauman
Last active March 15, 2024 20:51
Show Gist options
  • Save stevebauman/90e4190202e4262951f9339b99f895dc to your computer and use it in GitHub Desktop.
Save stevebauman/90e4190202e4262951f9339b99f895dc to your computer and use it in GitHub Desktop.
PHP CS Fixer GitHub Action
name: fix-style
on:
push:
pull_request:
paths:
- '**.php'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '7.4'
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment