Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
zap

GitHub Action

PHP_CodeSniffer Check with Annotations

v1.1.1

PHP_CodeSniffer Check with Annotations

zap

PHP_CodeSniffer Check with Annotations

PHPCS checker with auto annotations out of the box

Installation

Copy and paste the following snippet into your .yml file.

              

- name: PHP_CodeSniffer Check with Annotations

uses: chekalsky/[email protected]

Learn more about this action in chekalsky/phpcs-action

Choose a version

PHP CodeSniffer GitHub Action

This action will help you to run phpcs (PHP_CodeSniffer) with GitHub Actions platform. It also supports annotations out of the box — you don't need to use any tokens to make it work.

How Annotations Works

Usage

Add the following code to .github/workflows/phpcs.yml file.

name: PHPCS check

on: pull_request

jobs:
  phpcs:
      name: PHPCS
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - name: PHPCS check
          uses: chekalsky/phpcs-action@v1

Eventually you could also check for warnings.

        ...
        - name: PHPCS check
          uses: chekalsky/phpcs-action@v1
            with:
              enable_warnings: true

You probably would like to have configuration file for PHP_CodeSniffer in order to make it work as you like.