-
-
Notifications
You must be signed in to change notification settings - Fork 24
40 lines (32 loc) · 1.12 KB
/
csfix.yml
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
32
33
34
35
36
37
38
39
40
name: Auto Format PHP
on:
pull_request:
paths:
- '**.php'
- 'cs2pr'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
# dont run on forks. requires commit access
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.0
coverage: none # disable xdebug, pcov
tools: cs2pr
- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --verbose"
- uses: stefanzweifel/git-auto-commit-action@v2.5.0
with:
commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.STAABM_TOKEN }}
- run: vendor/bin/php-cs-fixer fix --diff --dry-run --format=checkstyle | cs2pr # check whether there are still errors left