Skip to content

Merge pull request #209 from 10up/dependabot/npm_and_yarn/npm_and_yar… #508

Merge pull request #209 from 10up/dependabot/npm_and_yarn/npm_and_yar…

Merge pull request #209 from 10up/dependabot/npm_and_yarn/npm_and_yar… #508

Workflow file for this run

name: Linting
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node and npm cache
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install Node dependencies
run: npm ci --no-optional
- name: Get updated JS files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.js
- name: composer install
run: composer install --ignore-platform-reqs
- name: Check PHPCS standard
run: ./vendor/bin/phpcs -i
- name: PHPCS check
id: phpcs
run: ./vendor/bin/phpcs . --runtime-set testVersion 7.4- --report-checkstyle=${RUNNER_TEMP}/phpcs-report.xml
- name: Run JS linting
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
run: ./node_modules/.bin/10up-toolkit lint-js ${{ steps.changed-files.outputs.all_changed_files }}