Last active
March 15, 2024 20:51
-
-
Save stevebauman/90e4190202e4262951f9339b99f895dc to your computer and use it in GitHub Desktop.
PHP CS Fixer GitHub Action
This file contains 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: 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