Skip to content

Commit dfe7ff7

Browse files
committed
ci: pint for pr and main branches
1 parent 5bc9976 commit dfe7ff7

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/pint-pr.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PHP Linting
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
phplint:
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
steps:
14+
- name: Checkout pull request head
15+
if: github.event_name == 'pull_request'
16+
uses: actions/checkout@v4
17+
with:
18+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
19+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
20+
21+
- name: "laravel-pint"
22+
uses: aglipanci/laravel-pint-action@latest
23+
with:
24+
preset: laravel
25+
verboseMode: true
26+
27+
- uses: stefanzweifel/git-auto-commit-action@v5
28+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
29+
with:
30+
commit_message: "fix: pint :robot:"

.github/workflows/pint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: PHP Linting
22
on:
3-
pull_request:
43
push:
54
branches:
65
- master
@@ -18,8 +17,7 @@ jobs:
1817
if: github.event_name == 'pull_request'
1918
uses: actions/checkout@v4
2019
with:
21-
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
22-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
20+
ref: ${{ github.head_ref }}
2321

2422
- name: "laravel-pint"
2523
uses: aglipanci/laravel-pint-action@latest

0 commit comments

Comments
 (0)