Skip to content

Commit 9bc6ce1

Browse files
committed
~ Updated PHPCS GitHub Action to only run on blames in PRs rather than all files (required creating new GitHub Action)
1 parent 5f90521 commit 9bc6ce1

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
name: PHP Lint
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
47

58
jobs:
69
PHPCS:
710
name: PHPCS
811
runs-on: ubuntu-latest
912
steps:
1013
- uses: actions/checkout@v2
14+
1115
- name: Install dependencies
1216
run: composer install --dev --prefer-dist --no-progress --no-suggest
17+
1318
- name: PHPCS check
1419
uses: chekalsky/phpcs-action@v1
1520
with:

.github/workflows/php-lint-pr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PHP Lint (PR)
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
PHPCS:
7+
name: PHPCS (Files Changed)
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0 # The blame will not work without this
13+
14+
# PHP 8 will throw PHP Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in ...
15+
- uses: nanasess/setup-php@v3
16+
with:
17+
php-version: '7.4'
18+
19+
- name: Install dependencies
20+
run: composer install --dev --prefer-dist --no-progress --no-suggest
21+
22+
- uses: thenabeel/action-phpcs@v8
23+
with:
24+
files: "**.php,**.js,**.css"
25+
phpcs_path: ./vendor/bin/phpcs
26+
standard: phpcs.xml

0 commit comments

Comments
 (0)