rozeo/phpstan-github-actions

There is no license information available for the latest version (1.0.0) of this package.

1.0.0 2020-06-23 09:56 UTC

README

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