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:
2525 onlyDiff :
2626 description : " only format changed files that differ from the provided branch"
2727 required : false
28-
28+
29+ parallel :
30+ description : " run Pint in parallel mode (requires Pint >= 1.23)"
31+ required : false
32+
2933 pintVersion :
3034 description : " laravel/pint composer version to install a specific version."
3135 required : false
32-
36+
3337 useComposer :
3438 description : " Use Laravel Pint version from project composer lock file. Lock file must be preset to use this flag."
3539 required : false
4246 - ${{ inputs.config-path }}
4347 - ${{ inputs.preset }}
4448 - ${{ inputs.only-dirty }}
49+ - ${{ inputs.onlyDiff }}
50+ - ${{ inputs.parallel }}
4551 - ${{ inputs.pint-version }}
4652 - ${{ inputs.use-composer }}
4753branding :
Original file line number Diff line number Diff line change 22set -e
33
44pint_install_command=(" composer global require laravel/pint:PINT_VERSION --no-progress --dev" )
5-
65if [[ " ${INPUT_PINTVERSION} " ]]
76then
87 pint_install_command=" ${pint_install_command/ PINT_VERSION/ ${INPUT_PINTVERSION} } "
1312 pint_install_command=" ${pint_install_command/: PINT_VERSION/ } "
1413fi
1514
16- pint_command=(" pint" )
15+ echo " Running Command: ${pint_install_command[@]} "
16+ ${pint_install_command[@]}
17+ PATH=" /tmp/vendor/bin:${PATH} "
1718
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" )
1823if [[ " ${INPUT_TESTMODE} " == true ]]; then
1924 pint_command+=" --test"
2025fi
@@ -39,9 +44,15 @@ if [[ "${INPUT_ONLYDIRTY}" == true ]]; then
3944 pint_command+=" --dirty"
4045fi
4146
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
4355
44- ${pint_install_command[@]}
4556PATH=" /tmp/vendor/bin:${PATH} "
4657
4758echo " Running Command: " " ${pint_command[@]} "
You can’t perform that action at this time.
0 commit comments