-
-
Notifications
You must be signed in to change notification settings - Fork 32
64 lines (52 loc) · 1.74 KB
/
Copy pathcs.yml
File metadata and controls
64 lines (52 loc) · 1.74 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Code Style
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'
jobs:
cs-fix:
name: PHP CS Fixer and Rector
runs-on: ubuntu-latest
permissions:
contents: write # Required to push automated CS fixes to the pull request branch.
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Install PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: 8.2
tools: composer:v2
coverage: none
- name: Install Composer dependencies
uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1
- name: Run PHP CS Fixer
run: ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php
- name: Run Rector
run: ./vendor/bin/rector --output-format=github
- name: Configure Git credentials
env:
GH_TOKEN: ${{ github.token }}
run: git config --global credential.helper '!f() { echo username=x-access-token; echo password=$GH_TOKEN; }; f'
- name: Commit changes
run: |
git add -- '*.php'
if git diff --cached --quiet; then
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Apply PHP CS Fixer and Rector changes (CI)"
git push