Update eslint.yml #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ESLint | |
on: | |
push: | |
branches: [ "master", "main" ] | |
pull_request: | |
branches: [ "master", "main" ] | |
schedule: | |
- cron: '18 13 * * 5' # Elke vrijdag om 13:18 UTC | |
jobs: | |
eslint: | |
name: Run ESLint scanning | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 # Gebruik de nieuwste versie | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install ESLint | |
run: | | |
npm ci # Zorgt voor een schone installatie volgens package-lock.json | |
npm install [email protected] @microsoft/[email protected] | |
- name: Run ESLint | |
env: | |
SARIF_ESLINT_IGNORE_SUPPRESSED: "true" | |
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 ESLint analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: eslint-results.sarif | |
wait-for-processing: true | |