-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
43 lines (38 loc) · 1.34 KB
/
action.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
name: 'Phpcs and reviewdog runner'
description: 'This action installs reviewdog 🐶, runs phpcs 🐘 and pipes output to reviewdog. It depends '
inputs:
reviewdog_token:
description: 'The Github API token needed for Reviewdog'
path:
description: 'In which directory should phpcs be sniffing?'
required: false
default: '.'
report_name:
description: 'Name of reviewdogs report'
required: false
default: 'phpcs'
runs:
using: 'composite'
steps:
- name: Install reviewdog
run: $GITHUB_ACTION_PATH/install.sh
shell: bash
env:
REVIEWDOG_VERSION: v0.14.1
REVIEWDOG_TEMPDIR: ${{ runner.temp }}
- name: Run phpcs and report to reviewdog
run: |
set +o pipefail
cd "${{ inputs.path }}"
# No warnings errors/warnings since it breaks the connection to reviewdog.
$(composer config bin-dir)/phpcs --config-set ignore_errors_on_exit 1
$(composer config bin-dir)/phpcs --config-set ignore_warnings_on_exit 1
# Run code sniffer.
$(composer config bin-dir)/phpcs --report=checkstyle \
| reviewdog -f=checkstyle -name="${{ inputs.report_name }}" -reporter=github-pr-check -fail-on-error=true
shell: bash
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ inputs.reviewdog_token }}
branding:
icon: 'terminal'
color: 'gray-dark'