SEO deploy gate — extract every JSON-LD block and assert it is valid JSON, a valid schema.org shape, and (optionally) consistent with the page.
- Invalid JSON — a trailing comma or unquoted key that silently disables
your rich result. (
JSONLD_INVALID_JSON) - Invalid schema.org shape — e.g. a
Productwith noname, or apricethat's an object instead of a string/number. (JSONLD_SCHEMA_INVALID) - Markup that lies (consistency mode) — the JSON-LD declares a
Product.name/Article.headlinethat doesn't appear in the rendered body. (JSONLD_INCONSISTENT) - Plus notices/warnings for nodes with no
@type(JSONLD_NO_TYPE), unknown types with no shipped schema (JSONLD_UNKNOWN_TYPE), and pages with no JSON-LD at all (JSONLD_NONE).
Pragmatic JSON Schema subsets for the rich-result types Google
acts on: Product, Article, BreadcrumbList, Organization, FAQPage. They
assert required fields and field shapes — not the entire schema.org vocabulary.
Unknown @types are reported as a notice and skipped, never failed.
- uses: nimajafari/seo-ci/actions/validate-jsonld@v1
with:
urls: |
https://www.example.com/products/widget
https://www.example.com/blog/launch-post
consistency: true # also assert the markup matches the page bodyAgainst build artifacts:
- uses: nimajafari/seo-ci/actions/validate-jsonld@v1
with:
urls: |
./dist/products/widget/index.html| Input | Default | Description |
|---|---|---|
urls |
— (required) | URLs or HTML file paths, one per line (JSON array accepted). |
consistency |
false |
Assert declared fields appear in the rendered body. |
strict |
false |
Treat warnings as errors. |
report-path |
"" |
Write the JSON report to this path. |
passed, errors, warnings, notices, report — see the
top-level README.
Caveat: A starting point, not a drop-in guarantee. The shipped schemas are a curated subset; extend
schemas/for your types. Consistency mode compares against server-rendered HTML — JSON-LD injected client-side won't be seen here (and Google may treat it differently). Never describe content to crawlers that users can't see; that's cloaking.