From 10b7b3107fc81711a0548cd13a343f3b2abab79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Fri, 24 Jun 2022 16:59:15 +0200 Subject: [PATCH 01/39] Updating README --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 645c316..4c6ab77 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: aglipanci/laravel-pint-action@main + - name: "laravel-pint" + uses: aglipanci/laravel-pint-action@0.1.0 + with: + preset: laravel + verboseMode: true + testMode: true + configPath: "vendor/my-company/coding-style/pint.json" + ``` -If provided, a `pint.json` file in the root will be used for configuration during run of the Action. \ No newline at end of file +If provided, a `pint.json` file in the root will be used for configuration during run of the Action. From 643466ad03b726047b3c78b531be5ec7835429ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Fri, 24 Jun 2022 17:52:11 +0200 Subject: [PATCH 02/39] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c6ab77..d9af527 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,8 @@ jobs: configPath: "vendor/my-company/coding-style/pint.json" ``` - If provided, a `pint.json` file in the root will be used for configuration during run of the Action. + +This action **DOESN'T** commit changes automatically. If you want to achieve such behaviour you have to use it in combination with another action like [git-auto-commit Action](https://github.com/stefanzweifel/git-auto-commit-action) or [Create Pull Request Action](https://github.com/marketplace/actions/create-pull-request) + + From a95c07fdd7b31adb89c6fa4ea5bf00ac67d6d0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 15 Aug 2022 21:14:05 +0200 Subject: [PATCH 03/39] updating README - updating README to use the latest version - adding link to the demo repository --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d9af527..7efa4f9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: "laravel-pint" - uses: aglipanci/laravel-pint-action@0.1.0 + uses: aglipanci/laravel-pint-action@1.0.0 with: preset: laravel verboseMode: true @@ -27,6 +27,8 @@ jobs: ``` If provided, a `pint.json` file in the root will be used for configuration during run of the Action. -This action **DOESN'T** commit changes automatically. If you want to achieve such behaviour you have to use it in combination with another action like [git-auto-commit Action](https://github.com/stefanzweifel/git-auto-commit-action) or [Create Pull Request Action](https://github.com/marketplace/actions/create-pull-request) +This action **DOESN'T** commit changes automatically. If you want to achieve such behaviour you have to use it in combination with another action like [git-auto-commit Action](https://github.com/stefanzweifel/git-auto-commit-action) or [Create Pull Request Action](https://github.com/marketplace/actions/create-pull-request). + +You can see Laravel Pint Action running on my [demo repository](https://github.com/aglipanci/laravel-pint-action-demo/pulls). 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 04/39] 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 05/39] 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 06/39] 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 07/39] 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 08/39] 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 09/39] 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 From 07f4f96d0e75037d5c9ff4f40963a9d086147747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 26 Dec 2022 20:58:24 +0100 Subject: [PATCH 10/39] Updating README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7efa4f9..364fd42 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ GitHub Action implementation of the [Laravel Pint](https://github.com/laravel/pi Use with [GitHub Actions](https://github.com/features/actions) -_.github/workflows/pint.yml_ +_.github/workflows/pint.yml ``` name: PHP Linting @@ -23,12 +23,13 @@ jobs: verboseMode: true testMode: true configPath: "vendor/my-company/coding-style/pint.json" + pintVersion: 1.2.1 ``` +ℹ️ Starting from version 2 you can specify the Pint version to be used by specifyling a `pintVersion` in your configuration file. + If provided, a `pint.json` file in the root will be used for configuration during run of the Action. This action **DOESN'T** commit changes automatically. If you want to achieve such behaviour you have to use it in combination with another action like [git-auto-commit Action](https://github.com/stefanzweifel/git-auto-commit-action) or [Create Pull Request Action](https://github.com/marketplace/actions/create-pull-request). You can see Laravel Pint Action running on my [demo repository](https://github.com/aglipanci/laravel-pint-action-demo/pulls). - - From 180ac902c04a7092d536e0ab637ac7557658056c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 26 Dec 2022 21:01:10 +0100 Subject: [PATCH 11/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 364fd42..f2c9d0c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: "laravel-pint" - uses: aglipanci/laravel-pint-action@1.0.0 + uses: aglipanci/laravel-pint-action@2.0.0 with: preset: laravel verboseMode: true From 5c0b1f6e11e8be570b1a73feef15f7ec6e92e0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 26 Dec 2022 21:25:04 +0100 Subject: [PATCH 12/39] Fixing the case of setting the testmode to false. --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a8f0cbb..e3b42ce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,11 +12,11 @@ fi pint_command=("pint") -if [[ "${INPUT_TESTMODE}" ]]; then +if [[ "${INPUT_TESTMODE}" == true ]]; then pint_command+=" --test" fi -if [[ "${INPUT_VERBOSEMODE}" ]]; then +if [[ "${INPUT_VERBOSEMODE}" == true ]]; then pint_command+=" -v" fi From 9f7f42dec493d4341d7ebad23cbb71efe40cc595 Mon Sep 17 00:00:00 2001 From: James Harley <27085725+JKHarley@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:52:38 +0000 Subject: [PATCH 13/39] Update entrypoint.sh --- entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index e3b42ce..b91d408 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,6 +28,10 @@ if [[ "${INPUT_PRESET}" ]]; then pint_command+=" --preset ${INPUT_PRESET}" fi +if [[ "${INPUT_ONLYDIRTY}" ]]; then + pint_command+=" --dirty" +fi + echo "Running Command: " "${pint_install_command[@]}" ${pint_install_command[@]} From 5f15f8d891305f1fcc718ea710ce62e1c9ebab6d Mon Sep 17 00:00:00 2001 From: James Harley <27085725+JKHarley@users.noreply.github.com> Date: Sat, 18 Mar 2023 10:53:40 +0000 Subject: [PATCH 14/39] change to formatting and add description --- README.md | 1 + action.yml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f2c9d0c..c04c489 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ jobs: testMode: true configPath: "vendor/my-company/coding-style/pint.json" pintVersion: 1.2.1 + onlyDirty: true ``` ℹ️ Starting from version 2 you can specify the Pint version to be used by specifyling a `pintVersion` in your configuration file. diff --git a/action.yml b/action.yml index 4ff1743..23c7f52 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,10 @@ inputs: description: "would you like to run Pint on verbose mode" required: false + onlyDirty: + description: "only format changed files" + required: false + configPath: description: "specify the custom config path" required: false @@ -19,7 +23,7 @@ inputs: required: false pintVersion: - description: "larave/pint composer version to install a specific version." + description: "laravel/pint composer version to install a specific version." required: false runs: using: 'docker' From 47f7a28ef1d1ff7d76f36f91aa711f2bdf355e48 Mon Sep 17 00:00:00 2001 From: James Harley <27085725+JKHarley@users.noreply.github.com> Date: Sat, 18 Mar 2023 10:56:57 +0000 Subject: [PATCH 15/39] format change --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 23c7f52..7b80653 100644 --- a/action.yml +++ b/action.yml @@ -10,10 +10,6 @@ inputs: description: "would you like to run Pint on verbose mode" required: false - onlyDirty: - description: "only format changed files" - required: false - configPath: description: "specify the custom config path" required: false @@ -21,6 +17,10 @@ inputs: preset: description: "pint preset" required: false + + onlyDirty: + description: "only format changed files" + required: false pintVersion: description: "laravel/pint composer version to install a specific version." From c412b9a744414388f9c14f0cd1edf2e1e2f18906 Mon Sep 17 00:00:00 2001 From: James Harley <27085725+JKHarley@users.noreply.github.com> Date: Sat, 18 Mar 2023 10:58:43 +0000 Subject: [PATCH 16/39] add input --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 7b80653..cd2d8b2 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,7 @@ runs: - ${{ inputs.verbose-mode }} - ${{ inputs.config-path }} - ${{ inputs.preset }} + - ${{ inputs.only-dirty }} - ${{ inputs.pint-version }} branding: icon: 'eye' From 859061e68a63d4a15fb0f2d0b64c23d7b9c597da Mon Sep 17 00:00:00 2001 From: Nathan James <64075030+Nathanjms@users.noreply.github.com> Date: Fri, 5 May 2023 09:53:05 +0100 Subject: [PATCH 17/39] Update README.md Fixes the pint version being too low for `--dirty` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c04c489..f4e5b07 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ jobs: verboseMode: true testMode: true configPath: "vendor/my-company/coding-style/pint.json" - pintVersion: 1.2.1 + pintVersion: 1.8.0 onlyDirty: true ``` 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 18/39] 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 19/39] 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 20/39] 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' From 4dae896c2a56596546a57fa4fa0b5ff7eb376d4b Mon Sep 17 00:00:00 2001 From: Madalin Tache Date: Wed, 31 May 2023 09:31:37 +0300 Subject: [PATCH 21/39] Update README.md Just a minor typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4e5b07..bbf2a31 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ jobs: onlyDirty: true ``` -ℹ️ Starting from version 2 you can specify the Pint version to be used by specifyling a `pintVersion` in your configuration file. +ℹ️ Starting from version 2 you can specify the Pint version to be used by specifying a `pintVersion` in your configuration file. If provided, a `pint.json` file in the root will be used for configuration during run of the Action. From 3271909b273f923005e1ccdda5c3aa59edab1fa4 Mon Sep 17 00:00:00 2001 From: AmirHosein Rahimi <87445571+ahr1384@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:11:22 +0330 Subject: [PATCH 22/39] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6fb6475..8bac46f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,7 +31,7 @@ if [[ "${INPUT_PRESET}" ]]; then pint_command+=" --preset ${INPUT_PRESET}" fi -if [[ "${INPUT_ONLYDIRTY}" ]]; then +if [[ "${INPUT_ONLYDIRTY}" == true ]]; then pint_command+=" --dirty" fi From fd9101579140644aca2b879d17f2b9ecf2e64d2b Mon Sep 17 00:00:00 2001 From: Agli Panci Date: Mon, 25 Dec 2023 16:15:56 +0100 Subject: [PATCH 23/39] adding tagger action --- .github/workflows/release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d587e25 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +--- +# https://github.com/marketplace/actions/actions-tagger +name: release + +"on": + release: + types: [published, edited] + workflow_dispatch: + +jobs: + actions-tagger: + runs-on: windows-latest + steps: + - uses: Actions-R-Us/actions-tagger@latest + with: + publish_latest_tag: true \ No newline at end of file From b3a414ad47b8f45c200e1731b901ca8eb1b1d1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 25 Dec 2023 16:17:21 +0100 Subject: [PATCH 24/39] Update release.yml --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d587e25..be6a962 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,3 @@ ---- # https://github.com/marketplace/actions/actions-tagger name: release @@ -13,4 +12,4 @@ jobs: steps: - uses: Actions-R-Us/actions-tagger@latest with: - publish_latest_tag: true \ No newline at end of file + publish_latest_tag: true From 61f2bc4f4d5da076029d370fa2f268fd6b298041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Mon, 25 Dec 2023 16:18:26 +0100 Subject: [PATCH 25/39] Update release.yml --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be6a962..298129d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,3 @@ -# https://github.com/marketplace/actions/actions-tagger name: release "on": @@ -11,5 +10,5 @@ jobs: runs-on: windows-latest steps: - uses: Actions-R-Us/actions-tagger@latest - with: + with: publish_latest_tag: true From 5edb397042085ba4939c704a47853b9e5829c9ee Mon Sep 17 00:00:00 2001 From: erikn69 Date: Tue, 26 Dec 2023 10:00:43 -0500 Subject: [PATCH 26/39] Update README example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbf2a31..d363781 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ jobs: phplint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: "laravel-pint" - uses: aglipanci/laravel-pint-action@2.0.0 + uses: aglipanci/laravel-pint-action@latest with: preset: laravel verboseMode: true From b7186f049990b9bdb59e5ee2d871c5d31f05a92f Mon Sep 17 00:00:00 2001 From: erikn69 Date: Fri, 24 Jan 2025 12:47:58 -0500 Subject: [PATCH 27/39] Pint --diff arg --- README.md | 5 +++-- action.yml | 4 ++++ entrypoint.sh | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d363781..5a1de1a 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ GitHub Action implementation of the [Laravel Pint](https://github.com/laravel/pi Use with [GitHub Actions](https://github.com/features/actions) -_.github/workflows/pint.yml +`_.github/workflows/pint.yml` -``` +```yml name: PHP Linting on: pull_request jobs: @@ -25,6 +25,7 @@ jobs: configPath: "vendor/my-company/coding-style/pint.json" pintVersion: 1.8.0 onlyDirty: true + # onlyDiff: "origin/main" ``` ℹ️ Starting from version 2 you can specify the Pint version to be used by specifying a `pintVersion` in your configuration file. diff --git a/action.yml b/action.yml index be1be9d..1a60611 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,10 @@ inputs: onlyDirty: description: "only format changed files" required: false + + onlyDiff: + description: "only format changed files that differ from the provided branch" + required: false pintVersion: description: "laravel/pint composer version to install a specific version." diff --git a/entrypoint.sh b/entrypoint.sh index 8bac46f..9a8c50f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,6 +31,11 @@ if [[ "${INPUT_PRESET}" ]]; then pint_command+=" --preset ${INPUT_PRESET}" fi +if [[ "${INPUT_ONLYDIFF}" ]]; then + pint_command+=" --diff=${INPUT_ONLYDIFF}" + INPUT_ONLYDIRTY=false +fi + if [[ "${INPUT_ONLYDIRTY}" == true ]]; then pint_command+=" --dirty" fi From 5b87bfbbbfc5c590817f6657b377489819acbcaa Mon Sep 17 00:00:00 2001 From: erikn69 Date: Mon, 27 Jan 2025 09:44:41 -0500 Subject: [PATCH 28/39] Support onlyDiff=true --- entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 9a8c50f..d47fa8a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,6 +31,15 @@ if [[ "${INPUT_PRESET}" ]]; then pint_command+=" --preset ${INPUT_PRESET}" fi +if [[ "${INPUT_ONLYDIFF}" == true ]]; then + if [[ -n "${GITHUB_TOKEN}" ]]; then + INPUT_ONLYDIFF=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}" | jq -r .default_branch) + else + INPUT_ONLYDIFF=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + fi +fi + if [[ "${INPUT_ONLYDIFF}" ]]; then pint_command+=" --diff=${INPUT_ONLYDIFF}" INPUT_ONLYDIRTY=false From 52c58b3acdf3e1eb9043ed9d70d733716822e894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Sun, 2 Feb 2025 21:21:20 +0100 Subject: [PATCH 29/39] diff branch only --- entrypoint.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index d47fa8a..fff66a7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,18 +31,8 @@ if [[ "${INPUT_PRESET}" ]]; then pint_command+=" --preset ${INPUT_PRESET}" fi -if [[ "${INPUT_ONLYDIFF}" == true ]]; then - if [[ -n "${GITHUB_TOKEN}" ]]; then - INPUT_ONLYDIFF=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}" | jq -r .default_branch) - else - INPUT_ONLYDIFF=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') - fi -fi - if [[ "${INPUT_ONLYDIFF}" ]]; then pint_command+=" --diff=${INPUT_ONLYDIFF}" - INPUT_ONLYDIRTY=false fi if [[ "${INPUT_ONLYDIRTY}" == true ]]; then From 9788b6d168d0aae14731495efa7934ac0914acc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Sun, 2 Feb 2025 21:22:18 +0100 Subject: [PATCH 30/39] updating documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a1de1a..267a23a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ jobs: configPath: "vendor/my-company/coding-style/pint.json" pintVersion: 1.8.0 onlyDirty: true - # onlyDiff: "origin/main" + onlyDiff: "main" ``` ℹ️ Starting from version 2 you can specify the Pint version to be used by specifying a `pintVersion` in your configuration file. From 964b229b30ec3daca427c0f3df23225d056a221a Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:32:54 -0400 Subject: [PATCH 31/39] added the option to run pint in parallel mode in v1.23 or more --- action.yml | 10 ++++++++-- entrypoint.sh | 38 +++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/action.yml b/action.yml index 1a60611..e616c45 100644 --- a/action.yml +++ b/action.yml @@ -25,11 +25,15 @@ inputs: onlyDiff: description: "only format changed files that differ from the provided branch" required: false - + + parallel: + description: "run Pint in parallel mode (requires Pint >= 1.23)" + required: false + 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 @@ -42,6 +46,8 @@ runs: - ${{ inputs.config-path }} - ${{ inputs.preset }} - ${{ inputs.only-dirty }} + - ${{ inputs.only-diff }} + - ${{ inputs.parallel }} - ${{ inputs.pint-version }} - ${{ inputs.use-composer }} branding: diff --git a/entrypoint.sh b/entrypoint.sh index fff66a7..e0d975b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,8 @@ #!/bin/bash set -e +# Install Pint pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-progress --dev") - if [[ "${INPUT_PINTVERSION}" ]] then pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINTVERSION}}" @@ -13,37 +13,49 @@ else pint_install_command="${pint_install_command/:PINT_VERSION/}" fi -pint_command=("pint") +echo "Running Command: " "${pint_install_command[@]}" +${pint_install_command[@]} +PATH="/tmp/vendor/bin:${PATH}" + +# Get version after installation +pint_version=$(pint --version | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' | head -1) +version_check=$(printf '%s\n1.23' "$pint_version" | sort -V | head -1) +# Build command with consistent array syntax +pint_command=("pint") if [[ "${INPUT_TESTMODE}" == true ]]; then - pint_command+=" --test" + pint_command+=("--test") fi if [[ "${INPUT_VERBOSEMODE}" == true ]]; then - pint_command+=" -v" + pint_command+=("-v") fi if [[ "${INPUT_CONFIGPATH}" ]]; then - pint_command+=" --config ${INPUT_CONFIGPATH}" + pint_command+=("--config" "${INPUT_CONFIGPATH}") fi if [[ "${INPUT_PRESET}" ]]; then - pint_command+=" --preset ${INPUT_PRESET}" + pint_command+=("--preset" "${INPUT_PRESET}") fi if [[ "${INPUT_ONLYDIFF}" ]]; then - pint_command+=" --diff=${INPUT_ONLYDIFF}" + pint_command+=("--diff=${INPUT_ONLYDIFF}") fi if [[ "${INPUT_ONLYDIRTY}" == true ]]; then - pint_command+=" --dirty" + pint_command+=("--dirty") fi -echo "Running Command: " "${pint_install_command[@]}" - -${pint_install_command[@]} -PATH="/tmp/vendor/bin:${PATH}" +if [[ "${INPUT_PARALLEL}" == true ]]; then + if [[ "$version_check" == "1.23" ]]; then + pint_command+=("--parallel") + echo "Parallel mode enabled (Pint version: $pint_version)" + else + echo "Warning: Parallel mode requested but Pint version $pint_version < 1.23. Skipping --parallel flag." + fi +fi echo "Running Command: " "${pint_command[@]}" -${pint_command[@]} +"${pint_command[@]}" From c509bff5551bf5ac924f2ada24e00f9fafb28317 Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:33:57 -0400 Subject: [PATCH 32/39] need these spaces --- entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index e0d975b..c2b406e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,32 +24,32 @@ version_check=$(printf '%s\n1.23' "$pint_version" | sort -V | head -1) # Build command with consistent array syntax pint_command=("pint") if [[ "${INPUT_TESTMODE}" == true ]]; then - pint_command+=("--test") + pint_command+=(" --test") fi if [[ "${INPUT_VERBOSEMODE}" == true ]]; then - pint_command+=("-v") + pint_command+=(" -v") fi if [[ "${INPUT_CONFIGPATH}" ]]; then - pint_command+=("--config" "${INPUT_CONFIGPATH}") + pint_command+=(" --config" "${INPUT_CONFIGPATH}") fi if [[ "${INPUT_PRESET}" ]]; then - pint_command+=("--preset" "${INPUT_PRESET}") + pint_command+=(" --preset" "${INPUT_PRESET}") fi if [[ "${INPUT_ONLYDIFF}" ]]; then - pint_command+=("--diff=${INPUT_ONLYDIFF}") + pint_command+=(" --diff=${INPUT_ONLYDIFF}") fi if [[ "${INPUT_ONLYDIRTY}" == true ]]; then - pint_command+=("--dirty") + pint_command+=(" --dirty") fi if [[ "${INPUT_PARALLEL}" == true ]]; then if [[ "$version_check" == "1.23" ]]; then - pint_command+=("--parallel") + pint_command+=(" --parallel") echo "Parallel mode enabled (Pint version: $pint_version)" else echo "Warning: Parallel mode requested but Pint version $pint_version < 1.23. Skipping --parallel flag." From e56dd62b26f2a607763df5710216c85881dc93f5 Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:35:35 -0400 Subject: [PATCH 33/39] style updates --- entrypoint.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c2b406e..7e7c483 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,15 +13,13 @@ else pint_install_command="${pint_install_command/:PINT_VERSION/}" fi -echo "Running Command: " "${pint_install_command[@]}" +echo "Running Command: ${pint_install_command[@]}" ${pint_install_command[@]} PATH="/tmp/vendor/bin:${PATH}" -# Get version after installation pint_version=$(pint --version | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' | head -1) version_check=$(printf '%s\n1.23' "$pint_version" | sort -V | head -1) -# Build command with consistent array syntax pint_command=("pint") if [[ "${INPUT_TESTMODE}" == true ]]; then pint_command+=(" --test") @@ -32,11 +30,11 @@ if [[ "${INPUT_VERBOSEMODE}" == true ]]; then fi if [[ "${INPUT_CONFIGPATH}" ]]; then - pint_command+=(" --config" "${INPUT_CONFIGPATH}") + pint_command+=(" --config ${INPUT_CONFIGPATH}") fi if [[ "${INPUT_PRESET}" ]]; then - pint_command+=(" --preset" "${INPUT_PRESET}") + pint_command+=(" --preset ${INPUT_PRESET}") fi if [[ "${INPUT_ONLYDIFF}" ]]; then @@ -56,6 +54,6 @@ if [[ "${INPUT_PARALLEL}" == true ]]; then fi fi -echo "Running Command: " "${pint_command[@]}" +echo "Running Command: ${pint_command[@]}" "${pint_command[@]}" From a260a3ec3b93d0e73ca5765934f3b8b34c4691d5 Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:36:32 -0400 Subject: [PATCH 34/39] unneeded --- entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7e7c483..6f2fb00 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,32 +22,32 @@ version_check=$(printf '%s\n1.23' "$pint_version" | sort -V | head -1) pint_command=("pint") if [[ "${INPUT_TESTMODE}" == true ]]; then - pint_command+=(" --test") + pint_command+=" --test" fi if [[ "${INPUT_VERBOSEMODE}" == true ]]; then - pint_command+=(" -v") + pint_command+=" -v" fi if [[ "${INPUT_CONFIGPATH}" ]]; then - pint_command+=(" --config ${INPUT_CONFIGPATH}") + pint_command+=" --config ${INPUT_CONFIGPATH}" fi if [[ "${INPUT_PRESET}" ]]; then - pint_command+=(" --preset ${INPUT_PRESET}") + pint_command+=" --preset ${INPUT_PRESET}" fi if [[ "${INPUT_ONLYDIFF}" ]]; then - pint_command+=(" --diff=${INPUT_ONLYDIFF}") + pint_command+=" --diff=${INPUT_ONLYDIFF}" fi if [[ "${INPUT_ONLYDIRTY}" == true ]]; then - pint_command+=(" --dirty") + pint_command+=" --dirty" fi if [[ "${INPUT_PARALLEL}" == true ]]; then if [[ "$version_check" == "1.23" ]]; then - pint_command+=(" --parallel") + pint_command+=" --parallel" echo "Parallel mode enabled (Pint version: $pint_version)" else echo "Warning: Parallel mode requested but Pint version $pint_version < 1.23. Skipping --parallel flag." From f157366817bde47d01c3014b692601c9a69a62eb Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:38:09 -0400 Subject: [PATCH 35/39] Update entrypoint.sh --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6f2fb00..ec04643 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -54,6 +54,11 @@ if [[ "${INPUT_PARALLEL}" == true ]]; then fi fi -echo "Running Command: ${pint_command[@]}" +echo "Running Command: " "${pint_install_command[@]}" -"${pint_command[@]}" +${pint_install_command[@]} +PATH="/tmp/vendor/bin:${PATH}" + +echo "Running Command: " "${pint_command[@]}" + +${pint_command[@]} From e24fc7c8e7219720ba64ec25e6286a1a978d947a Mon Sep 17 00:00:00 2001 From: Alex Hackney Date: Tue, 8 Jul 2025 12:39:05 -0400 Subject: [PATCH 36/39] Minor revisions --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index ec04643..3b2e33c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e -# Install Pint pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-progress --dev") if [[ "${INPUT_PINTVERSION}" ]] then From 86d87e4187499cc22f986af0ba41fa2aab35d282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Tue, 22 Jul 2025 11:01:08 +0200 Subject: [PATCH 37/39] Update entrypoint.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- entrypoint.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3b2e33c..b9a6dcf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -53,9 +53,6 @@ if [[ "${INPUT_PARALLEL}" == true ]]; then fi fi -echo "Running Command: " "${pint_install_command[@]}" - -${pint_install_command[@]} PATH="/tmp/vendor/bin:${PATH}" echo "Running Command: " "${pint_command[@]}" From 5b174992201fe0c1d4bb0d04a172a44aa38aeaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agli=20Pan=C3=A7i?= Date: Tue, 22 Jul 2025 11:01:33 +0200 Subject: [PATCH 38/39] Update action.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e616c45..fa55780 100644 --- a/action.yml +++ b/action.yml @@ -46,7 +46,7 @@ runs: - ${{ inputs.config-path }} - ${{ inputs.preset }} - ${{ inputs.only-dirty }} - - ${{ inputs.only-diff }} + - ${{ inputs.onlyDiff }} - ${{ inputs.parallel }} - ${{ inputs.pint-version }} - ${{ inputs.use-composer }} From 36de00d5f5a8a4e12d443e01671daa12a18f4c79 Mon Sep 17 00:00:00 2001 From: Agli Panci Date: Tue, 22 Jul 2025 11:09:01 +0200 Subject: [PATCH 39/39] Remove redundant PATH modification in entrypoint.sh --- entrypoint.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index b9a6dcf..e506b6a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -53,8 +53,6 @@ if [[ "${INPUT_PARALLEL}" == true ]]; then fi fi -PATH="/tmp/vendor/bin:${PATH}" - echo "Running Command: " "${pint_command[@]}" ${pint_command[@]}