build: Update composer dependencies #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |