Skip to content
Kotoshu Kotoshu 言修

Documentation

GitHub Action

kotoshu/action-kotoshu@v2 — spell-check files or whole trees in CI via the gem directory mode, apply baselines, and upload SARIF to the Security tab.

One step, no credentials. The Action installs the gem, pre-warms the languages you name, checks the files you glob, and uploads SARIF to the Security tab.

Quick start

jobs:
spell-check:
runs-on: ubuntu-latest
permissions:
security-events: write   # for the SARIF upload
steps:
- uses: actions/checkout@v4
- uses: kotoshu/action-kotoshu@v2
with:
files: "*.md docs/**/*.adoc"
language: en

Dictionaries are cached between runs under the default cache key; results land as code annotations and a SARIF report in the repository Security tab, plus a workflow artifact.

Switching CI on for an old repository with years of findings? Freeze the existing debt with kotoshu baseline init and keep inline ignore directives close to the words they excuse — the whole toolkit is on Ignores & baselines.

Inputs

InputDefaultPurpose
files.files or glob patterns, space-separated — expanded by the Action’s own bash globstar (see directory mode below)
languageautoany set-up language code, or auto to detect per file — pair it with prewarm_languages so the language is in cache
formatsariftext, json, or sarif
fail_on_errortruefail the step when errors are found
versionlatestpin the kotoshu gem version to install
prewarm_languagesenlanguages to set up before the check
offlinetrueskip the network — cached dictionaries only
output_pathkotoshu-results.sarifwhere the SARIF/JSON report is written

Outputs: sarif-path and error-count, for wiring into later steps. With offline: true the step still pre-warms with downloads allowed during the warm phase, then checks purely from cache — the pre-warm pattern from Caching & resources, already assembled.

Languages

language takes any language the installed gem has set up — check and pre-warm share one cache. The language matrix has twenty full-feature languages (ca cs da de el en es fr hu it nb nl pl pt ro ru sv tr uk vi) and semantic models for 55 — see the matrix. An honest pin: version: defaults to latest, so the step installs whatever RubyGems serves — 0.9.2 as of September 2026, full matrix pre-warmable. Pin an older cut and you gate yourself: 0.7.0 (July 2026) is the six-language one (en de es fr pt ru), 0.8.0 (August 2026) adds the wave-1 thirteen, 0.9.0 brings Norwegian and twenty.

Directory mode & baselines

Shipped in v2: one kotoshu check call walks the tree on the gem side (gitignore-aware, skips .git/node_modules/vendor/target), and a baseline path wires through --baseline. Errors the baseline covers pass as SARIF notes marked justification: baseline; only new errors fail the step when fail_on_error is true. Requires gem >= 0.8.0 (the default install is latest). v2 is tagged — pin kotoshu/action-kotoshu@v2. v2 is tagged — pin kotoshu/action-kotoshu@v2.

- uses: kotoshu/action-kotoshu@v2
with:
files: "."
language: en
baseline: .kotoshu-baseline.json
format: sarif

Until that cut ships, the same flow works by running the CLI step yourself: kotoshu baseline init ./*.md docs/**/*.adoc, commit the baseline, then kotoshu check . --baseline .kotoshu-baseline.json --format sarif — the full story is on Ignores & baselines and CLI reference — directory mode.

Validated 2026-09-05 — the workflow YAML above parses cleanly and its inputs match action-kotoshu v1’s action.yml field for field; the language input, the gem-side directory walk, and the baseline input were verified against the action’s action.yml and README at its current main. A full run against a test repository was judged overkill. Re-checked 2026-09-07 — action.yml at main is unchanged (no baseline input, globstar expansion still in the run step) and the unpinned install resolves to kotoshu 0.9.2 on RubyGems. action-kotoshu repo · action.yml