Skip to content

Commit

Permalink
Updated ESLint action
Browse files Browse the repository at this point in the history
  • Loading branch information
weishuhn committed Sep 19, 2023
1 parent 54015b9 commit 200d18b
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,25 @@ on:
- cron: '38 5 * * 3'

jobs:
eslint:
build:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
# required for all workflows
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install ESLint
run: |
npm install eslint@8.10.0
npm install @microsoft/eslint-formatter-sarif@2.1.7
- uses: actions/checkout@v4
- name: Run npm install
run: npm install
# Runs the ESlint code analysis
- name: Run ESLint
run: npx eslint .
--config .eslintrc.js
--ext .js,.jsx,.ts,.tsx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
# eslint exits 1 if it finds anything to report
run: node_modules/.bin/eslint build docs lib script spec-main -f node_modules/@microsoft/eslint-formatter-sarif/sarif.js -o results.sarif || true
# Uploads results.sarif to GitHub repository using the upload-sarif action
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif

0 comments on commit 200d18b

Please sign in to comment.