Skip to content

Commit

Permalink
Merge pull request #2 from bcgov/dev
Browse files Browse the repository at this point in the history
Add eslint github action workflow
  • Loading branch information
timwekkenbc authored May 7, 2024
2 parents d77eb4b + 20f4d4e commit 813fd90
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -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 [email protected]
- 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 }}"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 813fd90

Please sign in to comment.