A GitHub Action to lint clojure files with clj-kondo and reviewdog on pull requests to improve the code review experience.
The clojure-lint-action is used in almost every Wall Brew repository. If you'd like to see a sample GitHub workflow using this linter, please check out spoon That action was used as a CI/CD check in this Pull Request.
To receive automatic Pull Request comments with linter results:
name: Lint Clojure
on: [pull_request]
jobs:
clj-kondo:
name: runner / clj-kondo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: clj-kondo
uses: nnichols/clojure-lint-action@v10
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-reviewOptional.
${{ github.token }} is used by default.
Optional.
Report level for reviewdog- must be one of [info, warning, error].
It's the same as -level flag of reviewdog.
Default: error.
Optional.
Reporter of reviewdog command.
Must be one of [github-pr-check, github-pr-review, github-check].
Default is github-pr-check.
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
Optional.
Filtering mode for the reviewdog command.
Must be one of [added, diff_context, file, nofilter].
Default is added.
Optional.
Sets an exceptional exit code for reviewdog when errors are found.
Must be one of [true, false].
Default is false.
This is the authoritative control for whether lint findings fail the step; see Failure handling.
Optional. Additional reviewdog flags.
Optional.
Base directory to run clj-kondo.
Same as [path] of find command.
Default: .
Optional.
File name pattern for target files, used verbatim as the -name [pattern] test of the find command.
Default: empty, which matches the standard Clojure source extensions: *.clj, *.cljs, *.cljc, *.cljx, *.cljd, *.cljr.
The .git directory is always pruned, so Git internals are never linted regardless of branch name.
Optional.
Exclude patterns of target files.
Same as -not -path [exclude] of find command.
e.g. ./target/*
Note: .git is always excluded, so you do not need to list it here.
Optional.
Flags to pass to clj-kondo's --config option, which may either be in-line options or a path to a config file.
Default: '' (no additional config passed to clj-kondo).
The action sets clj-kondo's output pattern to {{filename}}:{{row}}:{{col}}: {{message}} so that reviewdog can parse the output via its -efm errorformat.
This pattern is fixed by the action and is not user-configurable; user-supplied clj_kondo_config values may adjust linters and other clj-kondo settings, but any output pattern they pass will be overridden by the action.
Optional.
Specifies the version of clj-kondo to use, passed as :mvn/version in clj-kondo's dependency map.
e.g. 2026.04.15.
Default: RELEASE, which resolves to the latest published version at run time.
clj-kondo's findings are piped to reviewdog.
Whether the step fails is controlled by fail_on_error (with level), which govern reviewdog's exit code.
With the default fail_on_error: false, findings are reported as annotations or PR comments without failing the build.
An internal clj-kondo error (exit code 1) always fails the step, even when fail_on_error is false, so a linter crash is never silently green.
Each run logs the clj-kondo and reviewdog exit codes and emits an ::error:: annotation when clj-kondo exits non-zero, to make failures easier to triage.
Copyright © Nick Nichols
Distributed under the MIT License
