djoezeke/clang-tidy-action
Run clang-tidy across tracked source files, collect diagnostics, and optionally create fix branches, pull requests, and inline reviews.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Apr 4, 2026
- License
- MIT
Pinned Snippet
uses: djoezeke/clang-tidy-action@f773fc8f195b0706f618614c4c578105609b9d56 # no releases — HEAD as of 2026-07-11tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| github_token | Token used to push the fix branch and create or update a pull request. | yes | — |
| clang_tidy_path | Path to the clang-tidy executable. | no | clang-tidy |
| build_directory | Directory containing compile_commands.json when using a compilation database. | no | build |
| compile_commands_path | Explicit path to compile_commands.json or to its containing directory. | no | "" |
| checks | clang-tidy checks to enable. | no | clang-analyzer-*,bugprone-*,modernize-*,performance-*,readability-* |
| source_extensions | Comma-separated list of source file extensions to analyze. | no | .c,.cc,.cpp,.cxx,.m,.mm,.h,.hh,.hpp,.hxx |
| exclude_paths | Comma-separated list of path fragments to ignore. | no | .git,node_modules,build |
| apply_fixes | Apply safe clang-tidy fixes to files. | no | true |
| create_pull_request | Create or update a pull request with the fixes. | no | true |
| base_branch | Base branch for the pull request. Defaults to the repository default branch. | no | "" |
| branch_prefix | Prefix for the generated fix branch. | no | clang-tidy/auto-fix |
| commit_message | Commit message used when fixes are committed. | no | chore: apply clang-tidy fixes |
| pr_title | Title for the pull request. | no | Apply clang-tidy fixes |
| pr_body | Optional extra text appended to the generated pull request body. | no | "" |
| thread_comments | Leave thread comments on the pull request. Options 'update', 'create', or 'off'. | no | update |
| analysis_scope | Scope of analysis. Use 'all' for all tracked files or 'changed' for files changed in the PR. | no | all |
| tidy_review | Create a PR review when clang-tidy issues are found. | no | true |
| review_event | Review event when posting PR review. Options 'comment' or 'request_changes'. | no | comment |
| file_annotations | Create GitHub file annotations for clang-tidy issues. | no | true |
| fail_on_diagnostics | Fail the action if clang-tidy finds any issues. | no | false |
| max_comments | Maximum number of comments to post (0 = unlimited). | no | 0 |
| suppress_warnings | Suppress clang-tidy warning-level diagnostics. | no | false |
| max_diagnostics | Maximum number of diagnostics used for review comments, annotations, and report output (0 = unlimited). | no | 0 |
| fail_on | Failure policy. Options 'none' (never fail), 'error' (fail on errors), or 'all' (fail on any warning/error). | no | none |
Outputs
| name | description |
|---|---|
| changed | Whether files were modified. |
| diagnostics | Number of clang-tidy diagnostics collected. |
| diagnostics_reported | Number of diagnostics included in report/review output after limits and suppression. |
| diagnostics_warnings | Number of warning-level diagnostics. |
| diagnostics_errors | Number of error-level diagnostics. |
| branch | Name of the generated branch. |
| pull_request_url | URL of the created or updated pull request. |
| review_id | ID of the created PR review. |
| report_path | Path to the generated markdown report. |