Skip to content

Commit

Permalink
Merge pull request #8 from likeadeckofcards/main
Browse files Browse the repository at this point in the history
Add a flag to use the local project's version of Laravel Pint
  • Loading branch information
aglipanci authored May 24, 2023
2 parents 0ac6db6 + 2d7710d commit 859b17c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
pintVersion:
description: "laravel/pint composer version to install a specific version."
required: false

useComposer:
description: "Use Laravel Pint version from project composer lock file. Lock file must be preset to use this flag."
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -35,6 +39,7 @@ runs:
- ${{ inputs.preset }}
- ${{ inputs.only-dirty }}
- ${{ inputs.pint-version }}
- ${{ inputs.use-composer }}
branding:
icon: 'eye'
color: 'gray-dark'
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-pr
if [[ "${INPUT_PINTVERSION}" ]]
then
pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINTVERSION}}"
elif [[ "${INPUT_USECOMPOSER}" ]]
then
pint_install_command="${pint_install_command/PINT_VERSION/$(composer show --locked | grep 'laravel/pint' | awk '{print $2}')}"
else
pint_install_command="${pint_install_command/:PINT_VERSION/}"
fi
Expand Down

0 comments on commit 859b17c

Please sign in to comment.