Skip to content

Commit 4d29b66

Browse files
committed
Add reusable phplinter-workflow
1 parent d777583 commit 4d29b66

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/phplinter.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
3+
name: 'phplinter'
4+
5+
on: # yamllint disable-line rule:truthy
6+
workflow_call:
7+
inputs:
8+
php-version:
9+
description: 'The PHP-version to use for linting'
10+
type: string
11+
required: true
12+
repository:
13+
description: 'The repository that needs linting'
14+
type: string
15+
required: true
16+
ref:
17+
description: 'The branch, tag or SHA that needs linting'
18+
type: string
19+
required: false
20+
default: 'master'
21+
22+
jobs:
23+
linter:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout Code
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
repository: ${{ inputs.repository }}
32+
ref: ${{ inputs.ref }}
33+
34+
- name: Setup PHP runtime
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
tools: phive
38+
php-version: ${{ inputs.php-version }}
39+
coverage: "none"
40+
41+
- name: Lint PHP files
42+
run: |
43+
phive install overtrue/phplint --force-accept-unsigned
44+
phplint --no-cache --no-progress -v

0 commit comments

Comments
 (0)