lint-eslint.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. #
  6. # Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
  7. # https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
  8. name: Lint eslint
  9. on:
  10. pull_request:
  11. paths:
  12. - '.github/workflows/**'
  13. - 'src/**'
  14. - 'appinfo/info.xml'
  15. - 'package.json'
  16. - 'package-lock.json'
  17. - 'tsconfig.json'
  18. - '.eslintrc.*'
  19. - '.eslintignore'
  20. - '**.js'
  21. - '**.ts'
  22. - '**.vue'
  23. permissions:
  24. contents: read
  25. concurrency:
  26. group: lint-eslint-${{ github.head_ref || github.run_id }}
  27. cancel-in-progress: true
  28. jobs:
  29. lint:
  30. runs-on: ubuntu-latest
  31. name: eslint
  32. steps:
  33. - name: Checkout
  34. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.6.0
  35. - name: Read package.json node and npm engines version
  36. uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
  37. id: versions
  38. with:
  39. fallbackNode: '^20'
  40. fallbackNpm: '^9'
  41. - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
  42. uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
  43. with:
  44. node-version: ${{ steps.versions.outputs.nodeVersion }}
  45. - name: Set up npm ${{ steps.versions.outputs.npmVersion }}
  46. run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
  47. - name: Install dependencies
  48. env:
  49. CYPRESS_INSTALL_BINARY: 0
  50. run: npm ci
  51. - name: Lint
  52. run: npm run lint