SchemaCheck/ DocsDashboard

Integrations

CI/CD Integration

Validate schema markup in your deployment pipeline. Catch structured data errors before they reach production.

GitHub ActionsGitLab CIBitbucket Pipelines

GitHub Actions

Validates schema on every push to main. Fails the workflow if errors are found.

yaml
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.com

Add 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.

yaml
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.com

The 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.

yaml
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.com

Batch 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

text
https://your-site.com/
https://your-site.com/about
https://your-site.com/blog/post-1
https://your-site.com/products/widget
yaml
- name: Batch Schema Validation
  run: npx schemacheck-cli batch urls.txt --api-key ${{ secrets.SCHEMACHECK_API_KEY }} --fail-on-errors

The 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

VariableRequiredDescription
SCHEMACHECK_API_KEYRequiredYour SchemaCheck API key. Get one free from the dashboard.
SITE_URLOptionalThe URL to validate. Can also be passed directly as a CLI argument.

Exit Codes

CodeMeaning
0Validation passed. No errors found (warnings may be present).
1Validation failed. One or more schema errors were found (requires --fail-on-errors).
2Score below threshold. The --min-score value was not met.
3API error. Invalid API key, quota exceeded, or network failure.

CLI Flags Reference

FlagTypeDefaultDescription
--api-keystringenvYour SchemaCheck API key. Falls back to SCHEMACHECK_API_KEY env var.
--fail-on-errorsbooleanfalseExit with code 1 if any schema errors are found.
--min-scorenumber0Fail if the validation score is below this threshold (0–100).
--formatstringjsonOutput format. One of json, table, summary.
--timeoutnumber30000Request timeout in milliseconds.
--outputstringstdoutWrite 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.