-
-
Notifications
You must be signed in to change notification settings - Fork 6
44 lines (35 loc) · 1.43 KB
/
php_cs_fixer.yaml
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
41
42
43
44
name: Format (PHP)
on: [push, pull_request, pull_request_target]
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
# dont run jobs on forks, because we are not allowed to commit
if: github.event.pull_request.draft == false && github.repository == 'simonschaufi/gkh_rss_import'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
# https://github.com/stefanzweifel/git-auto-commit-action#commits-of-this-action-do-not-trigger-new-workflow-runs
token: ${{ secrets.PAT }}
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none # disable xdebug, pcov
- name: Cache Composer Dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer Dependencies
run: composer install --no-progress
- name: Run php-cs-fixer
run: .Build/bin/php-cs-fixer fix --diff
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}