Skip to content

Feature/v4

Feature/v4 #62

Workflow file for this run

name: PHP Code Quality
on:
push:
branches:
- main
- develop
pull_request:
paths:
- "**.php"
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Composer dependencies
run: composer install
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Fetch the last 2 commits instead of just 1. (Fetching just 1 commit would overwrite the whole history)
fetch-depth: 2
- name: Install Composer dependencies
run: composer install
- name: Run php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix
- name: Get last commit message
id: last-commit-message
run: |
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ steps.last-commit-message.outputs.msg }}
commit_options: '--amend --no-edit'
push_options: '--force'
skip_fetch: true