Update NPM version and dependencies. #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JS Code Linting | |
on: | |
push: | |
branches: | |
- main | |
# Only run if JS/JSON/Lint/NVM files changed. | |
paths: | |
- '.github/workflows/js-lint.yml' | |
- '**.js' | |
- '**.json' | |
- '.eslint*' | |
- '.nvmrc' | |
- '.prettierignore' | |
- '.wp-env.json' | |
- '**/package.json' | |
- 'package-lock.json' | |
pull_request: | |
branches: | |
- main | |
- 'feature/**' | |
# Only run if JS/JSON/Lint/NVM files changed. | |
paths: | |
- '.github/workflows/js-lint.yml' | |
- '**.js' | |
- '**.json' | |
- '.eslint*' | |
- '.nvmrc' | |
- '.prettierignore' | |
- '.wp-env.json' | |
- '**/package.json' | |
- 'package-lock.json' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
js-lint: | |
name: JS Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: styfle/cancel-workflow-action@0.11.0 | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js (via .nvmrc) | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: npm install | |
run: npm ci | |
- name: JS Lint | |
run: npm run lint-js |