Skip to content

Commit

Permalink
Merge pull request #17 from JakeVdub/master
Browse files Browse the repository at this point in the history
Add PHP 8.4 Support & Update README.md
  • Loading branch information
Quetzacoalt91 authored Nov 25, 2024
2 parents fdda6e9 + e7b4dc3 commit 8cb6c6b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
13 changes: 13 additions & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM php:8.4

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/PrestaShopCorp/github-action-php-lint"
LABEL "homepage"="http://github.com/actions"
LABEL "maintainer"="PrestaShop <[email protected]>"

ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
18 changes: 18 additions & 0 deletions 8.4/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# action.yml
name: "Prestashop PHP 8.4 Linter"
description: "PHP linter for 8.4"
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 }}
5 changes: 5 additions & 0 deletions 8.4/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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\")"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ Using this action can be done with this template:
```
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: PHP syntax checker 7.2
uses: PrestaShopCorp/github-action-php-lint/7.2@v1
- name: PHP syntax checker 5.6
uses: PrestaShopCorp/github-action-php-lint/5.6@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
- name: PHP syntax checker 7.3
uses: PrestaShopCorp/github-action-php-lint/7.3@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
- name: PHP syntax checker 5.6
uses: PrestaShopCorp/github-action-php-lint/5.6@v1
- name: PHP syntax checker 8.4
uses: PrestaShopCorp/github-action-php-lint/8.4@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
```

The action ignores the folder `vendor` at root of project by default.

In this example, your workflow will run the PHP syntax check with PHP 5.6, 7.2 & 7.3.
In this example, your workflow will run the PHP syntax check with PHP 5.6, 7.3 & 8.4.

0 comments on commit 8cb6c6b

Please sign in to comment.