From 1951464c23a0ff172c27338fb26d94edffaf02ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:28:22 -0400 Subject: [PATCH 1/2] Create eslint.yml --- .github/workflows/eslint.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..0a5844f --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,39 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: ESLint + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + eslint: + name: Run eslint scanning + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install ESLint + run: | + npm i eslint + - name: Run ESLint + run: npx eslint . + --ext .js + --output-file eslint-results.sarif + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: eslint-results.sarif + wait-for-processing: true From 842fcf186b45487718a07e6d842fe057dcc4407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:39:30 -0400 Subject: [PATCH 2/2] forgot sarif format in eslint.yml --- .github/workflows/eslint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 0a5844f..195f996 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -25,10 +25,12 @@ jobs: - name: Install ESLint run: | - npm i eslint + npm i eslint # this should sync with package-lock + npm i @microsoft/eslint-formatter-sarif@2.1.7 - name: Run ESLint run: npx eslint . --ext .js + --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif continue-on-error: true