From 20f4d4e8bde1ca9d6bc5b8420cc1b9c78dc323a6 Mon Sep 17 00:00:00 2001 From: timwekkenbc Date: Tue, 7 May 2024 09:33:31 -0700 Subject: [PATCH] Add eslint github action workflow --- .github/workflows/eslint.yml | 41 ++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 42 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..bdb3b3e --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,41 @@ +# ESLint is a tool for identifying and reporting on patterns +# found in ECMAScript/JavaScript code. +# More details at https://github.com/eslint/eslint +# and https://eslint.org + +name: ESLint + +on: + push: + branches: '*' + pull_request: + branches: ['main', 'dev'] + +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 + + - name: Install ESLint + run: | + npm install eslint@8.10.0 + + - name: Run ESLint + run: npm run lint:pipeline + continue-on-error: true + + - name: Upload ESLint report + uses: actions/upload-artifact@v2 + with: + name: eslint-report + path: eslint-report.html + + - name: Display ESLint report link + run: echo "::set-output name=eslint-report::${{ steps.upload.outputs.artifact_path }}" diff --git a/package.json b/package.json index e07693a..6d86333 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "next build", "start": "next start -p 8080", "lint": "next lint", + "lint:pipeline": "next lint --fix --format=html --output-file=eslint-report.html", "test": "jest", "test:watch": "jest --watch" },