Skip to content

Commit b7186f0

Browse files
committed
Pint --diff arg
1 parent 80d3ca3 commit b7186f0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ GitHub Action implementation of the [Laravel Pint](https://github.com/laravel/pi
66

77
Use with [GitHub Actions](https://github.com/features/actions)
88

9-
_.github/workflows/pint.yml
9+
`_.github/workflows/pint.yml`
1010

11-
```
11+
```yml
1212
name: PHP Linting
1313
on: pull_request
1414
jobs:
@@ -25,6 +25,7 @@ jobs:
2525
configPath: "vendor/my-company/coding-style/pint.json"
2626
pintVersion: 1.8.0
2727
onlyDirty: true
28+
# onlyDiff: "origin/main"
2829

2930
```
3031
ℹ️ Starting from version 2 you can specify the Pint version to be used by specifying a `pintVersion` in your configuration file.

Diff for: action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
onlyDirty:
2222
description: "only format changed files"
2323
required: false
24+
25+
onlyDiff:
26+
description: "only format changed files that differ from the provided branch"
27+
required: false
2428

2529
pintVersion:
2630
description: "laravel/pint composer version to install a specific version."

Diff for: entrypoint.sh

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ if [[ "${INPUT_PRESET}" ]]; then
3131
pint_command+=" --preset ${INPUT_PRESET}"
3232
fi
3333

34+
if [[ "${INPUT_ONLYDIFF}" ]]; then
35+
pint_command+=" --diff=${INPUT_ONLYDIFF}"
36+
INPUT_ONLYDIRTY=false
37+
fi
38+
3439
if [[ "${INPUT_ONLYDIRTY}" == true ]]; then
3540
pint_command+=" --dirty"
3641
fi

0 commit comments

Comments
 (0)