name: Check Test Files

on:
  pull_request:
    branches:
      - '**'
      - '!release/*'
  pull_request_target:
    branches:
      - master

jobs:
  check-tests:
    runs-on: ubuntu-latest
    continue-on-error: true
    steps:
      - name: Checkout code
        uses: actions/checkout@v3.5.3
        with:
          fetch-depth: 0

      - name: Use Node.js
        uses: actions/setup-node@v3.7.0
        with:
          node-version: 18.x

      - run: npm install --prefix=.github/scripts --no-package-lock

      - name: Check for test files
        run: node .github/scripts/check-tests.mjs
