-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (43 loc) · 1.48 KB
/
phpcs.yml
File metadata and controls
48 lines (43 loc) · 1.48 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
44
45
46
47
48
name: 'CQC: PHP CodeSniffer (PHPCS)'
on:
workflow_call:
secrets:
OP_SERVICE_ACCOUNT_TOKEN:
required: true
description: '1Password Service Account Token to use for populating composer auth.json'
OP_VAULT:
description: '1Password vault to use for populating composer auth.json'
required: false
OP_ITEM:
description: '1Password item to use for populating composer auth.json'
required: false
jobs:
phpcs:
name: phpcs
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Detect file changes'
uses: dorny/paths-filter@v3
id: changed-files
with:
list-files: shell
filters: |
phpcs:
- added|modified: 'wp-content/plugins/core/**/*.php'
- added|modified: 'wp-content/themes/core/**/*.php'
- added|modified: 'wp-content/mu-plugins/**/*.php'
- added|modified: 'phpcs.xml.dist'
- name: 'Composer install'
if: steps.changed-files.outputs.phpcs == 'true'
uses: ./.github/actions/composer-install
with:
COMPOSER_INSTALL_FLAGS: '--optimize-autoloader'
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
OP_VAULT: ${{ secrets.OP_VAULT }}
OP_ITEM: ${{ secrets.OP_ITEM }}
- name: 'Run PHPCS'
if: steps.changed-files.outputs.phpcs == 'true'
run: |
composer phpcs