Skip to content

Commit 8cf2f62

Browse files
committed
chore: adds JavaScript quality checks workflow
Implements a GitHub Actions workflow to automatically lint JavaScript code in the `src` directory on pull requests and pushes to the main branch. This ensures code quality and consistency by running `wp-script lint:js` on the specified files. The workflow also configures concurrency to cancel in-progress runs for pull requests, preventing redundant checks.
1 parent 43dc486 commit 8cf2f62

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/quality-js.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Javascript Quality Checks
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'src/**'
7+
push:
8+
paths:
9+
- 'src/**'
10+
branches:
11+
- main
12+
13+
# Cancels all previous workflow runs for pull requests that have not completed.
14+
concurrency:
15+
# The concurrency group contains the workflow name and the branch name for pull requests
16+
# or the commit hash for any other events.
17+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
checks:
22+
name: Lint JS
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout project
27+
uses: actions/checkout@v3
28+
29+
- name: Setup NodeJS
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: 'package.json'
33+
34+
- name: Install npm dependencies
35+
run: npm ci
36+
37+
- name: Run wp-script lint:js on src folder
38+
run: npm run lint:js src

0 commit comments

Comments
 (0)