-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
42 lines (33 loc) · 1.06 KB
/
lint_php.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
name: PHP linting (Pint)
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: Lint php ${{ github.ref }}
cancel-in-progress: true
jobs:
phplint:
runs-on: ubuntu-latest
name: PHP linting (Pint)
strategy:
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Get pint version
id: pint
run: |
echo "version=$(composer show laravel/pint --locked --format=json | jq -r '.versions[0]' | sed 's/v//')" >> $GITHUB_OUTPUT
- name: laravel-pint
uses: aglipanci/[email protected]
with:
configPath: pint.json
pintVersion: ${{ steps.pint.outputs.version }}
- name: Check if there is any file update needed
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo -e "Waiting modifications:\n$status"
echo "::error::Laravel pint found fixes. Please run 'vendor/bin/pint' prior to your next commit."
exit -1
fi