Integrations
CI/CD Integration
Validate schema markup in your deployment pipeline. Catch structured data errors before they reach production.
GitHub Actions
Validates schema on every push to main. Fails the workflow if errors are found.
name: Schema Validation
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
schema-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Schema Markup
run: |
npx schemacheck-cli validate ${{ env.SITE_URL }} \
--api-key ${{ secrets.SCHEMACHECK_API_KEY }} \
--fail-on-errors \
--min-score 70 \
--format table
env:
SITE_URL: https://your-site.comAdd SCHEMACHECK_API_KEY to your repository's Settings → Secrets and variables → Actions. Never commit your API key directly to the workflow file.
GitLab CI
Add this job to your .gitlab-ci.yml. Set SCHEMACHECK_API_KEY under Settings → CI/CD → Variables.
schema-validation:
stage: test
image: node:20-slim
script:
- npx schemacheck-cli validate $SITE_URL
--api-key $SCHEMACHECK_API_KEY
--fail-on-errors
--format table
variables:
SITE_URL: https://your-site.comThe test stage runs after build by default. Move the job to a later stage (e.g. validate) if you prefer to check the deployed URL rather than the source.
Bitbucket Pipelines
Add to bitbucket-pipelines.yml at the project root. Store SCHEMACHECK_API_KEY in Repository settings → Repository variables.
image: node:20-slim
pipelines:
default:
- step:
name: Validate Schema Markup
script:
- npx schemacheck-cli validate $SITE_URL
--api-key $SCHEMACHECK_API_KEY
--fail-on-errors
--format table
variables:
SITE_URL: https://your-site.comBatch Validate Multiple URLs
Create a urls.txt file with one URL per line, then pass it to the batch command. Useful for validating all key pages in one pipeline step.
urls.txt
https://your-site.com/
https://your-site.com/about
https://your-site.com/blog/post-1
https://your-site.com/products/widget- name: Batch Schema Validation
run: npx schemacheck-cli batch urls.txt --api-key ${{ secrets.SCHEMACHECK_API_KEY }} --fail-on-errorsThe batch command returns a non-zero exit code if any URL has schema errors, failing the pipeline step automatically when --fail-on-errors is set.
Environment Variables
| Variable | Required | Description |
|---|---|---|
| SCHEMACHECK_API_KEY | Required | Your SchemaCheck API key. Get one free from the dashboard. |
| SITE_URL | Optional | The URL to validate. Can also be passed directly as a CLI argument. |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Validation passed. No errors found (warnings may be present). |
| 1 | Validation failed. One or more schema errors were found (requires --fail-on-errors). |
| 2 | Score below threshold. The --min-score value was not met. |
| 3 | API error. Invalid API key, quota exceeded, or network failure. |
CLI Flags Reference
| Flag | Type | Default | Description |
|---|---|---|---|
| --api-key | string | env | Your SchemaCheck API key. Falls back to SCHEMACHECK_API_KEY env var. |
| --fail-on-errors | boolean | false | Exit with code 1 if any schema errors are found. |
| --min-score | number | 0 | Fail if the validation score is below this threshold (0–100). |
| --format | string | json | Output format. One of json, table, summary. |
| --timeout | number | 30000 | Request timeout in milliseconds. |
| --output | string | stdout | Write output to a file instead of stdout. |
Validate the deployed URL, not the source
For best results, trigger schema validation after your deployment step completes so the CLI checks the live, rendered page. Structured data injected by JavaScript won't be visible in static source files.