-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.5 KB
/
Copy pathcode-style.yml
File metadata and controls
59 lines (51 loc) · 1.5 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
name: PHP Code Style
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
code-style:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: true
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: php-cs-fixer:3
- name: Fix PHP code style
if: >-
github.event_name != 'pull_request' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: >-
php-cs-fixer fix
--config=.php-cs-fixer.dist.php
--using-cache=no
- name: Check PHP code style
if: github.event_name == 'pull_request'
run: >-
php-cs-fixer fix
--config=.php-cs-fixer.dist.php
--using-cache=no
--dry-run
--diff
- name: Create pull request
if: >-
github.event_name != 'pull_request' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: peter-evans/create-pull-request@v7
with:
commit-message: Fix PHP code style
title: Fix PHP code style
body: |
Update PHP formatting using PHP CS Fixer.
branch: automated/php-code-style
base: ${{ github.event.repository.default_branch }}
delete-branch: true