lintel-github-action
Validate JSON, YAML, and TOML files against JSON Schema in your pull requests. Creates a GitHub Check Run named Lintel with inline annotations using the Checks API.
This is the binary behind the lintel-rs/action GitHub Action.
Quick start
name: Lint
on:
permissions:
checks: write
contents: read
jobs:
lintel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lintel-rs/action@v0
With zero configuration Lintel auto-discovers files and matches them against schemas from the SchemaStore catalog.
Action inputs
| Input | Description | Default |
|---|---|---|
version |
lintel-github-action version to install |
latest |
github-token |
GitHub token for creating Check Runs | ${{ github.token }} |
paths |
Space-separated paths or globs to validate | (auto-discover) |
exclude |
Comma-separated exclude patterns | |
args |
Additional arguments passed to the binary |
Examples
Validate specific paths
- uses: lintel-rs/action@v0
with:
paths: "config/**/*.yaml src/*.json"
Exclude directories
- uses: lintel-rs/action@v0
with:
exclude: "vendor/**, node_modules/**"
Pin a specific version
- uses: lintel-rs/action@v0
with:
version: v0.0.9
Configuration
Place a lintel.toml in your repository root to configure schema mappings, exclude patterns, and more. See the Lintel documentation for details.
How it works
- Downloads the
lintel-github-actionbinary from the action releases - Runs Lintel validation on your repository files
- Creates a GitHub Check Run with inline annotations on files with schema violations (batched at 50 per API call)
- Reports pass/fail with a summary table
Permissions
The action needs checks: write to create Check Runs and contents: read to access repository files.
permissions:
checks: write
contents: read
Environment variables
When running the binary directly (outside the GitHub Action wrapper), these environment variables are required:
| Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub token with checks:write permission |
GITHUB_REPOSITORY |
Repository in owner/repo format |
GITHUB_SHA |
Commit SHA to annotate |
GITHUB_API_URL |
GitHub API base URL (defaults to https://api.github.com) |
All of these are set automatically when running inside GitHub Actions.
License
Apache-2.0