Skip to content

Commit 859b17c

Browse files
authored
Merge pull request #8 from likeadeckofcards/main
Add a flag to use the local project's version of Laravel Pint
2 parents 0ac6db6 + 2d7710d commit 859b17c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
pintVersion:
2626
description: "laravel/pint composer version to install a specific version."
2727
required: false
28+
29+
useComposer:
30+
description: "Use Laravel Pint version from project composer lock file. Lock file must be preset to use this flag."
31+
required: false
2832
runs:
2933
using: 'docker'
3034
image: 'Dockerfile'
@@ -35,6 +39,7 @@ runs:
3539
- ${{ inputs.preset }}
3640
- ${{ inputs.only-dirty }}
3741
- ${{ inputs.pint-version }}
42+
- ${{ inputs.use-composer }}
3843
branding:
3944
icon: 'eye'
4045
color: 'gray-dark'

entrypoint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-pr
66
if [[ "${INPUT_PINTVERSION}" ]]
77
then
88
pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINTVERSION}}"
9+
elif [[ "${INPUT_USECOMPOSER}" ]]
10+
then
11+
pint_install_command="${pint_install_command/PINT_VERSION/$(composer show --locked | grep 'laravel/pint' | awk '{print $2}')}"
912
else
1013
pint_install_command="${pint_install_command/:PINT_VERSION/}"
1114
fi

0 commit comments

Comments
 (0)