eslint.yml 854 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: ESLint Check
  2. on:
  3. push:
  4. paths:
  5. - 'js/**/*.js'
  6. - 'js/package-lock.json'
  7. - .github/workflows/eslint.yml
  8. pull_request:
  9. paths:
  10. - 'js/**/*.js'
  11. - 'js/package-lock.json'
  12. - .github/workflows/eslint.yml
  13. permissions: {}
  14. jobs:
  15. eslint:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Checkout repository
  19. uses: actions/checkout@v7
  20. with:
  21. persist-credentials: false
  22. - name: Set up Node.js
  23. uses: actions/setup-node@v7
  24. with:
  25. node-version: '20'
  26. - name: Install dependencies
  27. run: |
  28. if [ -f js/package.json ]; then
  29. cd js && npm ci
  30. fi
  31. - name: Run ESLint
  32. run: |
  33. if [ -f js/package.json ]; then
  34. cd js && npx eslint .
  35. else
  36. npx eslint js/
  37. fi