-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (49 loc) · 1.61 KB
/
phpcbf-check.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
48
49
50
51
52
53
54
55
56
57
58
name: PHP Code Beautifier Check
on:
push:
paths-ignore:
- '**.md'
- '**.txt'
- '**.yml'
pull_request:
workflow_dispatch:
jobs:
phpcbf:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1' # Adjust this to your PHP version
extensions: uopz
- name: Install PHP_CodeSniffer
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
- name: Run phpcbf
id: cbf
continue-on-error: true
run: |
./vendor/bin/phpcbf -q --parallel=1 src templates assets
# report-phpcbf:
# needs: phpcbf
# if: ${{ always() && contains(needs.*.result, 'failure') }}
# runs-on: ubuntu-latest
# steps:
- name: Find Comment
if: steps.cbf.outcome == 'failure'
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: PHP Code Beautifier and Fixer found the following fixable issues
- name: Create or update comment
if: steps.cbf.outcome == 'failure'
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
PHP Code Beautifier and Fixer found the following fixable issues, fix them first to ammend to contribution guidelines.
edit-mode: replace