-
Notifications
You must be signed in to change notification settings - Fork 5.8k
43 lines (36 loc) · 1.06 KB
/
lint-php.yml
File metadata and controls
43 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: "PHP Linter"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
paths:
- "**.php"
- ".github/linters/phpcs.xml"
- ".github/workflows/php-lint.yml"
permissions:
contents: read
jobs:
phpcs:
name: "PHP Linter"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
with:
files: "/php/**/*.php"
- name: Install PHP_CodeSniffer
if: steps.changed-files.outputs.any_changed == 'true'
run: |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --version
- name: Run PHPCS
uses: thenabeel/action-phpcs@v8
if: steps.changed-files.outputs.any_changed == 'true'
with:
files: "**.php"
phpcs_path: php phpcs.phar
standard: ".github/linters/phpcs.xml"