name: Lint

on:
  pull_request:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref }}
  cancel-in-progress: true

permissions:
  checks: write
  contents: read
  pull-requests: read

jobs:
  lint:
    runs-on: ubuntu-22.04
    timeout-minutes: 5
    steps:
      - name: Check out Git repository
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          ref: ${{ github.event.pull_request.head.sha || github.ref }}

      - name: Install Node and npm packages
        uses: ./.github/actions/setup-node-env

      - name: Run ESLint
        run: yarn lint
