forked from autobrr/autobrr
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.02 KB
/
eslint.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: "ESLint analysis"
on:
push:
branches: [ "develop", "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "develop" ]
schedule:
- cron: '20 13 * * 6'
env:
NODE_VERSION: '20.17.0'
jobs:
codeql:
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up corepack
run: corepack enable
# It can not be done before enable corepack
- name: Set up cache
uses: actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Fetch web dependencies
working-directory: web
run: pnpm install --frozen-lockfile
# Runs the ESlint code analysis
- name: Run ESLint
# eslint exits 1 if it finds anything to report
run: SARIF_ESLINT_EMBED=true pnpm run lint:ci
working-directory: web
- name: Replace React trash
run: sed -i 's$Please see details in message$https://reactjs.org/is-broken-sarif-trash/$g' results.sarif
- name: Anyone home?
# eslint exits 1 if it finds anything to report
run: cat results.sarif
# Uploads results.sarif to GitHub repository using the upload-sarif action
- uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
category: ESLint
- uses: CatChen/eslint-suggestion-action@v4
with:
request-changes: true
fail-check: false
github-token: ${{ secrets.GITHUB_TOKEN }}
directory: 'web'
targets: 'web/src'