Skip to content

Latest commit

 

History

History
46 lines (42 loc) · 990 Bytes

README.md

File metadata and controls

46 lines (42 loc) · 990 Bytes

phpstan-github-actions

PHPStan support for Github Pull Request On Github Actions

Output Sample #1 (comment)

Setup

  1. add dependecy in composer.json
"rozeo/phpstan-github-actions": "^1.0.0"
  1. put phpstan.neon setting file on repository root.
touch phpstan.neon
  1. setting phpstan and add phpstan custom formatter. ex.)
parameters:
	level: 5
	paths:
		- src

services:
    errorFormatter.markdown:
    	class: Rozeo\PHPStanAction\PHPStanMarkdownFormatter
  1. add rules on workflow file(based php workflow).
on:
  pull_request:
    branches:
      - branch
~~~
- name: composer install
  run: composer install
  
- name: running phpstan
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    GITHUB_URL: ${{ github.event.pull_request.comments_url }}
    GITHUB_SHA: ${{ github.sha }}
    GITHUB_REPOSITORY: ${{ github.repository }}
  run: ./vendor/bin/phpstan-github-actions