-
Notifications
You must be signed in to change notification settings - Fork 138
47 lines (40 loc) · 1.2 KB
/
php-cs-on-changes.yml
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
44
45
46
47
name: PHP Coding Standards - PR Changed Files
on:
pull_request:
paths:
- "**.php"
- .github/workflows/php-cs-on-changes.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
php: [7.4, 8.3]
name: Code sniff (PHP ${{ matrix.php }}, WP Latest)
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare PHP ${{ matrix.php }}
uses: woocommerce/grow/prepare-php@actions-v1
with:
php-version: ${{ matrix.php }}
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: "**/*.php"
- name: Tool versions
run: |
php --version
composer --version
vendor/bin/phpcs-changed --version
- name: Run PHPCS
if: steps.changed-files.outputs.any_changed == 'true'
run: vendor/bin/phpcs-changed --warning-severity=0 -s --git --git-base ${{ github.event.pull_request.base.sha }} ${{ steps.changed-files.outputs.all_changed_files }}