Skip to content

Commit fbd6d4d

Browse files
authored
Merge pull request #567 from phparkitect/claude/add-cs-fixer-ci-fi7jN
2 parents 5378d17 + 3ce6eae commit fbd6d4d

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ jobs:
4242
- name: Install dependencies
4343
run: composer install --prefer-dist
4444

45-
- name: Coding Standard Checks
46-
if: ${{ matrix.php-versions == '8.0' }}
47-
run: PHP_CS_FIXER_IGNORE_ENV=1 ./bin/php-cs-fixer fix --dry-run --diff
48-
4945
- name: Static Analysis
5046
if: ${{ matrix.php-versions == '8.0' }}
5147
run: ./bin/psalm.phar --no-cache

.github/workflows/cs-fixer.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PHP CS Fixer
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
cs-fixer:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v6
14+
with:
15+
ref: ${{ github.head_ref }}
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Install PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.0'
22+
tools: composer:v2.2
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Cache Composer packages
27+
uses: actions/cache@v5
28+
with:
29+
path: vendor
30+
key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-php-cs-fixer-
33+
34+
- name: Install dependencies
35+
run: composer install --prefer-dist
36+
37+
- name: Run PHP CS Fixer
38+
run: ./bin/php-cs-fixer fix --diff
39+
40+
- name: Commit CS Fixer fixes
41+
uses: stefanzweifel/git-auto-commit-action@v5
42+
with:
43+
commit_message: "style: apply php-cs-fixer changes"
44+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

0 commit comments

Comments
 (0)