-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (48 loc) · 1.47 KB
/
coding-standards.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Fix code styling
on:
push:
pull_request_target:
workflow_dispatch:
inputs:
php:
description: 'Php version'
default: "8.3"
type: string
message:
description: 'Commit message'
default: Fix code styling.
type: string
jobs:
laravel-pint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php || 8.3 }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install Pint
run: composer global require laravel/pint
- name: Run Pint
run: pint --config ./formaters/pint.json
- name: Install NPM dependencies
run: npm ci -C ./src
- name: Copy blade-formatter config to root dir
run: |
cp formaters/.bladeformatterrc.json ./
cp formaters/.bladeignore ./
- name: Run Blade Formatter
run: |
src/node_modules/.bin/blade-formatter --write \
src/resources/views/*.blade.php \
src/resources/views/**/*.blade.php
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ inputs.message }} Format ${{ github.actor }} code