yaml-schema-lint GitHub Action

March 13, 2026 · View on GitHub

A composite GitHub Action that lints YAML files against JSON schemas using yaml-schema-lint and creates a GitHub Check with inline annotations and a markdown summary

Usage

yaml-schema-lint:
  runs-on: ubuntu-latest
  permissions:
    contents: read
    checks: write
    pull-requests: read
  steps:
    - uses: actions/checkout@v4

    - uses: X-Guardian/yaml-schema-lint-action@v1.0.0
      with:
        patterns: "'**/*.yml' '**/*.yaml'"

Inputs

InputDescriptionRequiredDefault
patternsYAML file paths or glob patterns (space-separated)Yes
ignoreGlob patterns to exclude (space-separated)No**/node_modules/**
settings-pathPath to a VS Code settings.json with yaml.schemasNo.vscode/settings.json
no-schema-storeDisable fetching schemas from schemastore.orgNofalse
versionyaml-schema-lint version to install (ignored when binary is set)No1.1.0
binaryPath to a local yaml-schema-lint binary (skips npx install)No
node-versionNode.js version to useNo24
check-nameName shown in the GitHub Checks tabNoYAML Schema Lint Report
fail-on-errorFail the check when errors are foundNotrue
fail-on-warningFail the check when warnings are foundNotrue
only-pr-filesOnly annotate files changed in the pull requestNotrue
markdown-report-on-step-summaryWrite a markdown summary to the step summaryNotrue

Permissions

The job using this action needs the following permissions:

permissions:
  contents: read # to checkout the repository
  checks: write # to create the Check Run
  pull-requests: read # to list PR-changed files (when only-pr-files is true)

How it works

  1. Setup Node.js using actions/setup-node
  2. Install and run yaml-schema-lint, producing a JSON report
  3. Create a GitHub Check Run via the Checks API with:
    • A conclusion of success or failure based on the fail-on-error / fail-on-warning inputs
    • Inline annotations on the PR diff for each diagnostic
    • A markdown summary table written to the GitHub Actions step summary
    • Annotations are batched (max 50 per API call) to handle large reports