name: Check for broken links in docs

on:
  pull_request:
    branches: ["main"]
    paths:
      - "docs/**"

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

      - name: Use Node.Js
        uses: actions/setup-node@v4
        with:
            node-version: '20.x'

      - name: Install Mintlify CLI
        run: npm i -g mintlify

      - name: Check for broken links
        working-directory: docs
        run: mintlify broken-links
