Skip to content

sergotail/laravel-pint-action

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

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for Laravel Pint

GitHub Action for the Laravel Pint Package. Also, annotation based on a Checkstyle XML-report is available.

Usage

Use with GitHub Actions

Sample contents of .github/workflows/pint.yml

name: PHP Lint

on:
  push:
    branches:
      - master
  pull_request:
    branches-ignore:
      - 'dependabot/npm_and_yarn/*'
      - 'dependabot/composer/*'
  schedule:
    - cron: '0 0 * * *'

jobs:
  phplint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@v39

      - name: Run Laravel Pint
        uses: sergotail/laravel-pint-action@v2.0.0
        with:
          onlyFiles: ${{ steps.changed-files.outputs.all_changed_files }}
          testMode: true
          verboseMode: true
          configPath: ./pint.json
          preset: laravel
          onlyDirty: false
          annotate: true
          pintVersion: 1.8.0
          annotateVersion: 1.8.5
          useComposer: true

ℹ️ Also you can specify the Pint version to be used by specifying a pintVersion in your configuration file.

Even when useComposer is endabled, pintVersion and annotateVersion are checked first, and only then the lock file is checked.

annotate option uses annotate-pull-request-from-checkstyle package to annotate pull request based on a Checkstyle XML-report. When annotation is enabled, pint is running in test mode.

This action DOESN'T commit changes automatically. If you want to achieve such behaviour you have to use it in combination with another action like git-auto-commit Action or Create Pull Request Action. Note that in this case you have to disable testMode.

About

GitHub Action for the Laravel Pint

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •