-
-
Notifications
You must be signed in to change notification settings - Fork 26
43 lines (36 loc) · 1.27 KB
/
format_php.yml
File metadata and controls
43 lines (36 loc) · 1.27 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
name: Format (PHP)
on:
workflow_dispatch:
push:
paths:
- '**.php'
- '.composer.json'
- '.github/workflows/format_php.yml'
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: bcmath, curl, dom, filter, gd, hash, intl, json, libxml, mbstring, openssl, pdo_mysql, pdo # keep in sync with composer.json
coverage: none
- name: Cache composer dependencies
uses: actions/cache@v2
id: composer-cache
with:
path: vendor
key: composer-${{ hashFiles('composer.json') }}
- name: Run composer install
if: steps.composer-cache.outputs.cache-hit != 'true' # run composer install only when actions/cache haven't restored cached /vendor dir
run: composer install -q --no-interaction --no-scripts --no-progress --prefer-dist --no-ansi
- name: Fix detected PHP coding style issues
id: fix_php
run: composer php:fix
continue-on-error: true
- name: Commit PHP code-style fixes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "✨ Apply coding style fixes to PHP"