Skip to content

Laravel Pint Action

Actions
Runs Laravel Pint with specified parameters
v2.0.0
Latest
Star (4)

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.

Laravel Pint Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Runs Laravel Pint with specified parameters
v2.0.0
Latest

Laravel Pint Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.