Skip to content
Latchkey

How to Run a Spellcheck in GitHub Actions

Typos in docs and identifiers slip past review; a spellcheck catches the obvious ones automatically.

Run codespell across the repo with an ignore list for intentional jargon so genuine typos fail the job.

Steps

  • Install codespell with pip.
  • Run it against the tree with a --skip list for vendored paths.
  • Maintain an ignore-words file for domain terms it flags incorrectly.

Workflow

.github/workflows/spellcheck.yml
name: Spellcheck
on: [pull_request]
jobs:
  spell:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - run: pip install codespell
      - run: codespell --skip='./node_modules,./dist,*.lock' --ignore-words=.codespellignore

Notes

  • Keep .codespellignore short and reviewed, or it quietly hides real typos.
  • On Latchkey managed runners spellcheck jobs run cheaper and self-heal if a runner dies.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →