Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
/ phpinsights-app Public archive

(IN-DEVELOPMENT) The must have GitHub action for PHP Insights

License

Notifications You must be signed in to change notification settings

worksome/phpinsights-app

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Insights App

PHP Insights - Code PHP Insights - Complexity PHP Insights - Architecture PHP Insights - Style

Running PHP Insights in the best way possible!

This tool will run PHP Insights for you and provide you with GitHub reviews, badges and more!
To use it add the example workflow file to your GitHub repository, and the GitHub Action will run automatically 🎩

Review Example Comment Review Example

Adding the following workflow file, will make phpinsights run on pull request, where it will create a review with the errors.
We also allow it here to run on pushes to the master branch. By allowing this, the badges for the master branch will be updated.

on:
  pull_request:
  push:
    branches:
      - master

jobs:
  static_analysis:
    runs-on: ubuntu-latest
    name: Static analysis
    steps:
      # You must check out your repository, so we can analyse it
      - name: Checkout
        uses: actions/checkout@v2
      - name: PHP Insights App
        uses: worksome/phpinsights-app@v0.1
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          workingDir: '.'
          memory_limit: '1024M'

The action has the following parameters:

  • repo_token: The GitHub API token, which is used to generate the review. Keeping it as ${{ secrets.GITHUB_TOKEN }} will make it use the token from the GitHub action.
  • workingDir: This set's the directory which we will run the tool on. This is useful if you have a repository with multiple projects in it.
  • config_path: (optional) Defines the path to where you php insights config file is, if it's not located in the default location.
  • memory_limit: (optional) Set's the PHP limit, if more than the default memory is needed to run php insights on your code.