-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (25 loc) · 812 Bytes
/
Copy pathformat.yml
File metadata and controls
33 lines (25 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: PHP CS Fixer and Commit
on:
push:
branches:
- main # Adjust this to your main branch
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP CS Fixer
run: |
composer global require friendsofphp/php-cs-fixer
echo "$HOME/.composer/vendor/bin" >> $GITHUB_PATH
- name: Run PHP CS Fixer
run: |
php-cs-fixer fix --config=.php_cs.dist.php --allow-risky=yes
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git diff --staged --quiet || git commit -m "Apply PHP-CS-Fixer"
git push origin $GITHUB_REF