-
-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (54 loc) · 1.57 KB
/
linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
name: Linting
on: # yamllint disable-line rule:truthy
pull_request: {}
push:
branches:
- main
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20.10.0"
- name: Cache yarn dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
.yarn/cache
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Run ESLint
uses: sibiraj-s/action-eslint@v3
with:
all-files: "true"
ignore-patterns: |
.github
.yarn
coverage
dist
node_modules
eslint-args: "-o eslint-results.sarif -f ${{ github.workspace }}/node_modules/@microsoft/eslint-formatter-sarif/sarif.js"
extensions: "js,jsx,ts,tsx"
annotations: true
- name: Upload to GHAS
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
category: "eslint"
sarif_file: "eslint-results.sarif"
pre-commit:
name: Pre-commit
uses: fabasoad/reusable-workflows/.github/workflows/wf-pre-commit.yml@main
with:
skip-hooks: "audit, build, eslint, test, snyk-test"