lint-eslint.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. push:
  12. branches:
  13. - master
  14. - stable*
  15. permissions:
  16. contents: read
  17. concurrency:
  18. group: lint-eslint-${{ github.head_ref || github.run_id }}
  19. cancel-in-progress: true
  20. jobs:
  21. lint:
  22. runs-on: ubuntu-latest
  23. name: eslint
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
  27. - name: Read package.json node and npm engines version
  28. uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
  29. id: versions
  30. with:
  31. fallbackNode: '^12'
  32. fallbackNpm: '^6'
  33. - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
  34. uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
  35. with:
  36. node-version: ${{ steps.versions.outputs.nodeVersion }}
  37. - name: Set up npm ${{ steps.versions.outputs.npmVersion }}
  38. run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
  39. - name: Install dependencies
  40. run: npm ci
  41. - name: Lint
  42. run: npm run lint