lint-eslint.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. - 'apps/**/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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
  35. - name: Read package.json node and npm engines version
  36. uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
  37. id: versions
  38. with:
  39. fallbackNode: '^16'
  40. fallbackNpm: '^7'
  41. - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
  42. uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # 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. run: npm ci
  49. - name: Lint
  50. run: npm run lint