Skip to content
check-square

GitHub Action

Schemar CI Action

v0.1.1 Latest version

Schemar CI Action

check-square

Schemar CI Action

Validate structured data on a website

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Schemar CI Action

uses: johnnyreilly/[email protected]

Learn more about this action in johnnyreilly/schemar

Choose a version

Schemar

GitHub Action for validating structured data

Contributor Covenant License: MIT Style: Prettier TypeScript: Strict

Usage

This action works by:

  1. Checking the supplied URL features structured data using the Schema.org validator
  2. If no structured data is found, the action fails. It also fails if the structured data is invalid.

For a single URL:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: johnnyreilly/[email protected]
        with:
          urls: https://johnnyreilly.com

name: Validate structured data

on:
  pull_request: ~
  push:
    branches:
      - main

For multiple URLs:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: johnnyreilly/[email protected]
        with:
          urls: |
            https://johnnyreilly.com
            https://johnnyreilly.com/about

name: Validate structured data

on:
  pull_request: ~
  push:
    branches:
      - main

To read more details about this GitHub Action and how to use it, please see this blog post.

Development

To develop this GitHub Action, you'll need Node.js 20 and pnpm. Then install the dependencies:

pnpm i

To run the action locally you can either use the debug script:

pnpm run debug

Or debug in VS Code using the Debug Action launch configuration.

Whichever you use, you configure inputs using the .env file.

💙 This package was templated with create-typescript-app.