-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (42 loc) · 1.41 KB
/
code-review.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
name: Code Review
on: [push, pull_request]
jobs:
laravel-pint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]
defaults:
run:
working-directory: ./app
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install Pint
run: composer global require laravel/pint
- name: Run Pint
run: pint --test
# Below adds the ability to for laravel pint to automatically commit the fixes
# Uncomment to auto fix and commit, or leave commented out to just fail
# - name: Get last commit message
# id: last-commit
# run: |
# echo "message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
# echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT
# - name: Commit linted files
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_author: ${{ steps.last-commit.outputs.author }}
# commit_message: ${{ steps.last-commit.outputs.message }}
# commit_options: '--amend --no-edit'
# push_options: '--force'
# skip_fetch: true