File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,15 @@ inputs:
25
25
onlyDiff :
26
26
description : " only format changed files that differ from the provided branch"
27
27
required : false
28
-
28
+
29
+ parallel :
30
+ description : " run Pint in parallel mode (requires Pint >= 1.23)"
31
+ required : false
32
+
29
33
pintVersion :
30
34
description : " laravel/pint composer version to install a specific version."
31
35
required : false
32
-
36
+
33
37
useComposer :
34
38
description : " Use Laravel Pint version from project composer lock file. Lock file must be preset to use this flag."
35
39
required : false
42
46
- ${{ inputs.config-path }}
43
47
- ${{ inputs.preset }}
44
48
- ${{ inputs.only-dirty }}
49
+ - ${{ inputs.onlyDiff }}
50
+ - ${{ inputs.parallel }}
45
51
- ${{ inputs.pint-version }}
46
52
- ${{ inputs.use-composer }}
47
53
branding :
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
pint_install_command=(" composer global require laravel/pint:PINT_VERSION --no-progress --dev" )
5
-
6
5
if [[ " ${INPUT_PINTVERSION} " ]]
7
6
then
8
7
pint_install_command=" ${pint_install_command/ PINT_VERSION/ ${INPUT_PINTVERSION} } "
13
12
pint_install_command=" ${pint_install_command/: PINT_VERSION/ } "
14
13
fi
15
14
16
- pint_command=(" pint" )
15
+ echo " Running Command: ${pint_install_command[@]} "
16
+ ${pint_install_command[@]}
17
+ PATH=" /tmp/vendor/bin:${PATH} "
17
18
19
+ pint_version=$( pint --version | grep -oE ' [0-9]+\.[0-9]+(\.[0-9]+)?' | head -1)
20
+ version_check=$( printf ' %s\n1.23' " $pint_version " | sort -V | head -1)
21
+
22
+ pint_command=(" pint" )
18
23
if [[ " ${INPUT_TESTMODE} " == true ]]; then
19
24
pint_command+=" --test"
20
25
fi
@@ -39,9 +44,15 @@ if [[ "${INPUT_ONLYDIRTY}" == true ]]; then
39
44
pint_command+=" --dirty"
40
45
fi
41
46
42
- echo " Running Command: " " ${pint_install_command[@]} "
47
+ if [[ " ${INPUT_PARALLEL} " == true ]]; then
48
+ if [[ " $version_check " == " 1.23" ]]; then
49
+ pint_command+=" --parallel"
50
+ echo " Parallel mode enabled (Pint version: $pint_version )"
51
+ else
52
+ echo " Warning: Parallel mode requested but Pint version $pint_version < 1.23. Skipping --parallel flag."
53
+ fi
54
+ fi
43
55
44
- ${pint_install_command[@]}
45
56
PATH=" /tmp/vendor/bin:${PATH} "
46
57
47
58
echo " Running Command: " " ${pint_command[@]} "
You can’t perform that action at this time.
0 commit comments