Skip to content

Automated patch release: 1.10.3 #561

Automated patch release: 1.10.3

Automated patch release: 1.10.3 #561

Workflow file for this run

name: Lint PHP
on:
pull_request:
types: [ opened, edited, reopened, ready_for_review ]
paths:
- '**.php'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
phpcs:
name: Run PHP Code Sniffer
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# User PHP 7.4 for compatibility with the WordPress codesniffer rules.
- name: Setup PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
with:
php-version: '7.3'
coverage: none
tools: phpcs
- name: Get changed files
uses: technote-space/get-diff-action@f27caffdd0fb9b13f4fc191c016bb4e0632844af # v6.1.2
with:
SUFFIX_FILTER: .php
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
if: "!! env.GIT_DIFF"
- name: Cache Composer vendor directory
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
if: "!! env.GIT_DIFF"
- name: Validate composer.json and composer.lock
run: composer validate
if: "!! env.GIT_DIFF"
- name: Install dependencies
run: composer install --no-progress --optimize-autoloader --prefer-dist
if: "!! env.GIT_DIFF"
- name: Detecting PHP Code Standards Violations
run: vendor/bin/phpcs --standard=phpcs.xml -s ${{ env.GIT_DIFF }}
if: "!! env.GIT_DIFF"