Skip to content

Commit 8a034a9

Browse files
authored
Merge pull request #2 from github/eslint-workflow
Add ESLint workflow
2 parents 2b2c14d + 94d7c40 commit 8a034a9

File tree

5 files changed

+4515
-36
lines changed

5 files changed

+4515
-36
lines changed

.github/workflows/eslint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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: [ "main" ]
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "main" ]
18+
schedule:
19+
- cron: '18 22 * * 0'
20+
21+
jobs:
22+
eslint:
23+
name: Run eslint scanning
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
security-events: write
28+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v3
32+
33+
- name: Install ESLint
34+
run: |
35+
npm install [email protected]
36+
npm install @microsoft/[email protected]
37+
npm install [email protected]
38+
39+
- name: Run ESLint
40+
run: |
41+
npx eslint . \
42+
--config eslint.config.js \
43+
--ext .js,.jsx,.ts,.tsx \
44+
--format @microsoft/eslint-formatter-sarif \
45+
--output-file eslint-results.sarif
46+
continue-on-error: true
47+
48+
- name: Upload analysis results to GitHub
49+
uses: github/codeql-action/upload-sarif@v3
50+
with:
51+
sarif_file: eslint-results.sarif
52+
wait-for-processing: true

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules/
22
.DS_Store
33
*.sljson
4-
*.log
5-
*.json
4+
*.log

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import github from 'eslint-plugin-github';
2+
3+
export default [
4+
{
5+
plugins: {
6+
github
7+
},
8+
},
9+
];

0 commit comments

Comments
 (0)