| name: JavaScript lint | |
| on: | |
| pull_request: | |
| paths: | |
| - .nvmrc | |
| - "**/*.js" | |
| - "**/*.mjs" | |
| - .github/workflows/pr-check_javascript.yml | |
| # No GITHUB_TOKEN permissions, as we only use it to increase API limit. | |
| permissions: {} | |
| jobs: | |
| lint-js: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint JavaScript files | |
| run: npm run lint:js | |