Mintlify’s hosted CI checks run automatically on pull requests without any pipeline configuration. Use this guide when you want to run the CLI in your own pipeline, gate merges on additional checks, or run validation outside GitHub.
Which commands to run
The CLI includes three commands well suited to CI:
Each command exits with a non-zero status code when it finds errors, which fails the CI job.
GitHub Actions
Add a workflow file at.github/workflows/docs-check.yml:
paths filter skips the workflow on pull requests that don’t touch documentation files, saving CI minutes.
GitLab CI
Add the following to.gitlab-ci.yml:
Pre-commit hook
Run the same checks locally before pushing by adding a pre-commit hook. Create.git/hooks/pre-commit and make it executable:
Scope checks to changed files
On large documentation sites, running the full link checker on every pull request can be slow. Pass--files to mint broken-links to scope the check to files that changed in the pull request.
The following GitHub Actions step checks only pages modified in the pull request:
Troubleshooting
mint: command not found: The npm install -g mint step didn’t install the CLI on the PATH used by the shell. Confirm your workflow uses actions/setup-node (or the equivalent) before installing, and that the install step runs in the same job as the check.
Broken link check flags valid external URLs: External URL checks depend on the network reachability of the target site from the CI runner. Rate limits and firewalls can cause false positives. Only add --check-external if you accept occasional flaky runs, or run external checks on a schedule instead of on every pull request.
Validation fails only in CI: Confirm the CI runner is checking out the same files you validated locally, including any generated OpenAPI files. If OpenAPI files are generated during the build, add that step to your workflow before running mint validate.