From 21e11273d8d496e7d7d1afac07d4125feac5293a Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Thu, 6 Jun 2024 09:08:41 +0200 Subject: [PATCH] Feature: Add support for PHP 8.3 --- 8.2/Dockerfile | 2 +- 8.3/Dockerfile | 13 +++++++++++++ 8.3/action.yml | 18 ++++++++++++++++++ 8.3/entrypoint.sh | 5 +++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 8.3/Dockerfile create mode 100644 8.3/action.yml create mode 100755 8.3/entrypoint.sh diff --git a/8.2/Dockerfile b/8.2/Dockerfile index ebecd7a..8b86bd6 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2-rc +FROM php:8.2 LABEL "com.github.actions.name"="PHP Syntax check" LABEL "com.github.actions.description"="Run the native PHP linter" diff --git a/8.3/Dockerfile b/8.3/Dockerfile new file mode 100644 index 0000000..ccf50eb --- /dev/null +++ b/8.3/Dockerfile @@ -0,0 +1,13 @@ +FROM php:8.3 + +LABEL "com.github.actions.name"="PHP Syntax check" +LABEL "com.github.actions.description"="Run the native PHP linter" +LABEL "com.github.actions.icon"="check" +LABEL "com.github.actions.color"="blue" + +LABEL "repository"="http://github.com/PrestaShop/github-action-php-lint" +LABEL "homepage"="http://github.com/actions" +LABEL "maintainer"="PrestaShop " + +ADD entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/8.3/action.yml b/8.3/action.yml new file mode 100644 index 0000000..fa03a19 --- /dev/null +++ b/8.3/action.yml @@ -0,0 +1,18 @@ +# action.yml +name: "Prestashop PHP 8.3 Linter" +description: "PHP linter for 8.3" +inputs: + folder-to-exclude: + description: "Folder to exclude" + required: false + default: '! -path "./vendor/*"' + working-directory: + description: "Working directory" + required: false + default: "./" +runs: + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.working-directory }} + - ${{ inputs.folder-to-exclude }} diff --git a/8.3/entrypoint.sh b/8.3/entrypoint.sh new file mode 100755 index 0000000..9977a36 --- /dev/null +++ b/8.3/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh -l + +cd $1 + +sh -c "! (find . -type f -name \"*.php\" $2 -exec php -l -n {} \; | grep -v \"No syntax errors detected\")"