adds simple validation for docs.json and broken links #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mintlify Documentation Checks | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '**.mdx' | |
| - '**.md' | |
| - 'docs.json' | |
| - '**.yaml' | |
| - '**.yml' | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| validate-docs-json: | |
| name: Validate docs.json | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Validate docs.json against Mintlify schema | |
| run: | | |
| # Install ajv-cli for JSON schema validation | |
| npm install -g ajv-cli ajv-formats | |
| # Download Mintlify schema | |
| curl -o mintlify-schema.json https://leaves.mintlify.com/schema/docs.json | |
| # Validate docs.json | |
| echo "Validating docs.json against Mintlify schema..." | |
| ajv validate -s mintlify-schema.json -d docs.json --strict=false --all-errors | |
| broken-links: | |
| name: Check Broken Links | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install Mintlify CLI | |
| run: npm install -g mint | |
| - name: Check for broken links | |
| run: mint broken-links |