Skip to content

Commit dece915

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Github Actions] ESLint splitted.
- eslint.yml => run multi-OS + multi-node-versions - eslint-code-scanning.yml => makes just only one report for github code scanning.
1 parent ae1e1bd commit dece915

File tree

2 files changed

+78
-12
lines changed

2 files changed

+78
-12
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
---
11+
12+
name: ESLint Code Scanning
13+
14+
15+
on: # yamllint disable-line rule:truthy
16+
push:
17+
branches: ["main"]
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: ["main"]
21+
workflow_dispatch:
22+
schedule:
23+
# ┌───────────── minute (0 - 59)
24+
# │ ┌───────────── hour (0 - 23)
25+
# │ │ ┌───────────── day of the month (1 - 31)
26+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
27+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
28+
# │ │ │ │ │
29+
# │ │ │ │ │
30+
# │ │ │ │ │
31+
# * * * * *
32+
- cron: '23 15 * * 2'
33+
34+
jobs:
35+
eslint:
36+
name: Run eslint scanning
37+
runs-on: ubuntu-24.04
38+
permissions:
39+
contents: read
40+
security-events: write
41+
# only required for a private repository by
42+
# github/codeql-action/upload-sarif to get the Action run status
43+
actions: read
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
47+
48+
- name: Set up Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 22.x
52+
53+
- name: Install ESLint
54+
run: |
55+
npm install --include=dev eslint@8.57.1
56+
npm install --include=dev @microsoft/eslint-formatter-sarif@3.0.0
57+
58+
- name: Test ESLint
59+
run: |
60+
npx --yes eslint --env-info
61+
62+
- name: Run ESLint
63+
run: >
64+
npx eslint .
65+
--color
66+
--max-warnings=0
67+
--format @microsoft/eslint-formatter-sarif
68+
--output-file eslint-results.sarif
69+
continue-on-error: true
70+
71+
- name: Upload analysis results to GitHub
72+
uses: github/codeql-action/upload-sarif@v3
73+
with:
74+
sarif_file: eslint-results.sarif
75+
wait-for-processing: true

.github/workflows/eslint.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on: # yamllint disable-line rule:truthy
1919
# The branches below must be a subset of the branches above
2020
branches: ["main"]
2121
workflow_dispatch:
22-
schedule:
22+
# schedule:
2323
# ┌───────────── minute (0 - 59)
2424
# │ ┌───────────── hour (0 - 23)
2525
# │ │ ┌───────────── day of the month (1 - 31)
@@ -29,7 +29,7 @@ on: # yamllint disable-line rule:truthy
2929
# │ │ │ │ │
3030
# │ │ │ │ │
3131
# * * * * *
32-
- cron: '23 15 * * 2'
32+
# - cron: '23 15 * * 2'
3333

3434
jobs:
3535
eslint:
@@ -59,7 +59,6 @@ jobs:
5959
- name: Install ESLint
6060
run: |
6161
npm install --include=dev eslint@8.57.1
62-
npm install --include=dev @microsoft/eslint-formatter-sarif@3.0.0
6362
6463
- name: Test ESLint
6564
run: |
@@ -70,12 +69,4 @@ jobs:
7069
npx eslint .
7170
--color
7271
--max-warnings=0
73-
--format @microsoft/eslint-formatter-sarif
74-
--output-file eslint-results.sarif
75-
continue-on-error: true
76-
77-
- name: Upload analysis results to GitHub
78-
uses: github/codeql-action/upload-sarif@v3
79-
with:
80-
sarif_file: eslint-results.sarif
81-
wait-for-processing: true
72+
&& echo '✔ Your code looks good.'

0 commit comments

Comments
 (0)