From 1fce957cceebb76d89d261d16848705af3ca659d Mon Sep 17 00:00:00 2001 From: Michael Deck <6399755+likeadeckofcards@users.noreply.github.com> Date: Tue, 23 May 2023 16:13:15 -0400 Subject: [PATCH 1/3] Get pint version from local composer --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index b91d408..6fb6475 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 From 95942006a7d29334cae2c20343912a779033de9f Mon Sep 17 00:00:00 2001 From: Michael Deck <6399755+likeadeckofcards@users.noreply.github.com> Date: Tue, 23 May 2023 16:16:17 -0400 Subject: [PATCH 2/3] Add new flag for using the local project pint version --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index cd2d8b2..619bb6e 100644 --- a/action.yml +++ b/action.yml @@ -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." + required: false runs: using: 'docker' image: 'Dockerfile' @@ -35,6 +39,7 @@ runs: - ${{ inputs.preset }} - ${{ inputs.only-dirty }} - ${{ inputs.pint-version }} + - ${{ inputs.use-composer }} branding: icon: 'eye' color: 'gray-dark' From 2d7710d6b3062db3b33c9d49c4f35c98c776b6b3 Mon Sep 17 00:00:00 2001 From: Michael Deck <6399755+likeadeckofcards@users.noreply.github.com> Date: Tue, 23 May 2023 16:23:43 -0400 Subject: [PATCH 3/3] Add extended note to useComposer flag --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 619bb6e..be1be9d 100644 --- a/action.yml +++ b/action.yml @@ -27,7 +27,7 @@ inputs: required: false useComposer: - description: "Use Laravel Pint version from project composer lock file." + description: "Use Laravel Pint version from project composer lock file. Lock file must be preset to use this flag." required: false runs: using: 'docker'