name: Docs checks

on:
  pull_request:
    paths:
      - "docs/**"
      - ".github/actions/validate-docs-links/**"

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  validate-docs-links:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - uses: ./.github/actions/setup-node

      - name: Run link checker
        run: cd docs/link-checker && pnpm run check-links
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  docs-quality:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - uses: ./.github/actions/setup-node

      - name: Install Global Turbo
        uses: ./.github/actions/install-global-turbo

      - name: Run docs specific checks
        run: turbo run check-spelling check-types lint
