-
-
Notifications
You must be signed in to change notification settings - Fork 18
41 lines (34 loc) · 918 Bytes
/
coding-standards.yml
File metadata and controls
41 lines (34 loc) · 918 Bytes
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
name: fix code styling
on:
workflow_call:
inputs:
php:
default: "8.1"
type: string
message:
default: Fix code styling
type: string
fix:
default: true
type: boolean
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install PHP CS
run: composer global require squizlabs/php_codesniffer
- name: Run Phpcbf
run: phpcbf --standard=psr11 --tab-width=4 --severity=4
- name: Commit linted files
if: ${{ inputs.fix }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ inputs.message }}