Skip to content

Commit

Permalink
require eslint for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed May 10, 2024
1 parent 032220e commit 2914e37
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint

on:
pull_request:
paths:
- "app/**"
push:
paths:
- "app/**"

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "16"

- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
app/node_modules
app/.yarn/cache
key: node-modules-${{ hashFiles('app/yarn.lock') }}

- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: cd app && yarn install

- name: Read ESLint Packages List and Lint
run: |
cd app
ESLINT_PACKAGES=$(grep -v '^#' ./eslint-packages.txt | xargs)
yarn eslint $ESLINT_PACKAGES --max-warnings=0
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- release/v[0-9]+.[0-9]+.[0-9]+

jobs:
lint:
uses: ./.github/workflows/lint.yml

build:
uses: ./.github/workflows/build.yml

Expand Down
1 change: 1 addition & 0 deletions app/eslint-packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
operators

0 comments on commit 2914e37

Please sign in to comment.