From 17f4cb9b5d3b47ed46ed00b67aef076c7306fa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:17:51 +0100 Subject: [PATCH 1/6] moving pint package installation to the entrypoint --- entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 118947c..0557d73 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,9 @@ if [[ "${INPUT_PRESET}" ]]; then command_string+=" --preset ${INPUT_PRESET}" fi +composer global require laravel/pint --no-progress --dev +PATH="/tmp/vendor/bin:${PATH}" + echo "Running Command: " "${command_string[@]}" -${command_string[@]} \ No newline at end of file +${command_string[@]} From 14b329e0e2d3dcd56f47ed5403b41f91af0b2e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:18:41 +0100 Subject: [PATCH 2/6] removing pint installation from the docker file --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72f7829..5a1440e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM composer:latest -RUN composer global require laravel/pint --no-progress --dev -ENV PATH="/tmp/vendor/bin:${PATH}" - COPY "entrypoint.sh" "/entrypoint.sh" RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] From f8d8a4fbd5fc81f0064ce14b0166f906356582e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:44:44 +0100 Subject: [PATCH 3/6] dynamic pint version --- entrypoint.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0557d73..fed0e3e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,15 @@ #!/bin/bash set -e +pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-progress --dev") + +if [[ "${INPUT_PINT_VERSION}" ]] +then + pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINT_VERSION}}" +else + pint_install_command="${pint_install_command/:PINT_VERSION/}" +fi + command_string=("pint") if [[ "${INPUT_TESTMODE}" ]]; then @@ -19,7 +28,7 @@ if [[ "${INPUT_PRESET}" ]]; then command_string+=" --preset ${INPUT_PRESET}" fi -composer global require laravel/pint --no-progress --dev +${pint_install_command[@]} PATH="/tmp/vendor/bin:${PATH}" echo "Running Command: " "${command_string[@]}" From 18945b813caa22e3c01057062ca73dc099dbe194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:50:02 +0100 Subject: [PATCH 4/6] adding pint version to actions.yml --- action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c5d7596..4ff1743 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,10 @@ inputs: preset: description: "pint preset" required: false + + pintVersion: + description: "larave/pint composer version to install a specific version." + required: false runs: using: 'docker' image: 'Dockerfile' @@ -25,6 +29,7 @@ runs: - ${{ inputs.verbose-mode }} - ${{ inputs.config-path }} - ${{ inputs.preset }} + - ${{ inputs.pint-version }} branding: icon: 'eye' - color: 'gray-dark' \ No newline at end of file + color: 'gray-dark' From 9258dcb4bb75f0c158f78fea0e10b002bf65e957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:54:24 +0100 Subject: [PATCH 5/6] Update entrypoint.sh --- entrypoint.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index fed0e3e..b74fc02 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,27 +10,29 @@ else pint_install_command="${pint_install_command/:PINT_VERSION/}" fi -command_string=("pint") +pint_command=("pint") if [[ "${INPUT_TESTMODE}" ]]; then - command_string+=" --test" + pint_command+=" --test" fi if [[ "${INPUT_VERBOSEMODE}" ]]; then - command_string+=" -v" + pint_command+=" -v" fi if [[ "${INPUT_CONFIGPATH}" ]]; then - command_string+=" --config ${INPUT_CONFIGPATH}" + pint_command+=" --config ${INPUT_CONFIGPATH}" fi if [[ "${INPUT_PRESET}" ]]; then - command_string+=" --preset ${INPUT_PRESET}" + pint_command+=" --preset ${INPUT_PRESET}" fi +echo "Running Command: " "${pint_install_command[@]}" + ${pint_install_command[@]} PATH="/tmp/vendor/bin:${PATH}" -echo "Running Command: " "${command_string[@]}" +echo "Running Command: " "${pint_command[@]}" -${command_string[@]} +${pint_command[@]} From 203c2fea1102e51381b31e153de5ea7296626c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Wed, 21 Dec 2022 23:56:19 +0100 Subject: [PATCH 6/6] Update entrypoint.sh --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index b74fc02..a8f0cbb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,9 +3,9 @@ set -e pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-progress --dev") -if [[ "${INPUT_PINT_VERSION}" ]] +if [[ "${INPUT_PINTVERSION}" ]] then - pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINT_VERSION}}" + pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINTVERSION}}" else pint_install_command="${pint_install_command/:PINT_VERSION/}" fi