on:
  pull_request_target

jobs:
  build:
    runs-on: ubuntu-latest
    if: github.event.pull_request.head.repo.full_name == github.repository
    env:
      HEAD: ${{ github.event.pull_request.head.sha }}
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - uses: actions/checkout@v2
        with:
          ref: ${{ env.HEAD }}
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 21
      - run: |
          npm install
          npm run lint
