Skip to content

Commit d37233e

Browse files
authored
Create eslint.yml
1 parent 84ec231 commit d37233e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/eslint.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# ESLint is a tool for identifying and reporting on patterns
6+
# found in ECMAScript/JavaScript code.
7+
# More details at https://github.com/eslint/eslint
8+
# and https://eslint.org
9+
10+
name: ESLint
11+
12+
on:
13+
push:
14+
branches: [ "trunk" ]
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "trunk" ]
18+
19+
jobs:
20+
eslint:
21+
name: Run eslint scanning
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
security-events: write
26+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Install ESLint
32+
run: |
33+
npm install [email protected]
34+
npm install @microsoft/[email protected]
35+
36+
- name: Run ESLint
37+
env:
38+
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
39+
run: npx eslint .
40+
--config .eslintrc.js
41+
--ext .js,.jsx,.ts,.tsx
42+
--format @microsoft/eslint-formatter-sarif
43+
--output-file eslint-results.sarif
44+
continue-on-error: true
45+
46+
- name: Upload analysis results to GitHub
47+
uses: github/codeql-action/upload-sarif@v3
48+
with:
49+
sarif_file: eslint-results.sarif
50+
wait-for-processing: true

0 commit comments

Comments
 (0)