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
| Input | Description | Required | Default |
|---|---|---|---|
patterns | YAML file paths or glob patterns (space-separated) | Yes | — |
ignore | Glob patterns to exclude (space-separated) | No | **/node_modules/** |
settings-path | Path to a VS Code settings.json with yaml.schemas | No | .vscode/settings.json |
no-schema-store | Disable fetching schemas from schemastore.org | No | false |
version | yaml-schema-lint version to install (ignored when binary is set) | No | 1.1.0 |
binary | Path to a local yaml-schema-lint binary (skips npx install) | No | — |
node-version | Node.js version to use | No | 24 |
check-name | Name shown in the GitHub Checks tab | No | YAML Schema Lint Report |
fail-on-error | Fail the check when errors are found | No | true |
fail-on-warning | Fail the check when warnings are found | No | true |
only-pr-files | Only annotate files changed in the pull request | No | true |
markdown-report-on-step-summary | Write a markdown summary to the step summary | No | true |
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
- Setup Node.js using
actions/setup-node - Install and run
yaml-schema-lint, producing a JSON report - Create a GitHub Check Run via the Checks API with:
- A conclusion of
successorfailurebased on thefail-on-error/fail-on-warninginputs - 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
- A conclusion of