Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ jobs:
both. `auto-fix` commits the clang-format fixes to the branch and needs `contents: write`.
- The action does not fail the job by itself; the last step does, using the `checks-failed`
output.
- Pull requests from forks get a read-only token: annotations still appear, but reviews are not
posted, and `thread-comments` would fail the step. Draft pull requests get no review.
- Pull requests from forks get a read-only token: annotations still appear, but reviews and
`thread-comments` are not posted. The [PR comments from forks](https://cpp-linter.github.io/cpp-linter-action/examples/) recipe
posts the comment from a second workflow. Draft pull requests get no review.

The [action docs](https://cpp-linter.github.io/cpp-linter-action/) list every input, output and
permission. [Moving to cpp-linter](blog/posts/2026-09-12-moving-to-cpp-linter.md) shows a
Expand Down
2 changes: 1 addition & 1 deletion docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ <h3 class="cl-h3">Annotations</h3>
<h3 class="cl-h3">Thread Comment</h3>
<code class="cl-inline-code">thread-comments</code>
</div>
<p>Set thread-comments: update and one comment lists the results, edited on each push while there are findings. It is posted by github-actions[bot] or your own App, and needs pull-requests: write, so it fails on pull requests from forks.</p>
<p>Set thread-comments: update and one comment lists the results, edited on each push while there are findings. It is posted by github-actions[bot] or your own App, and needs pull-requests: write, so pull requests from forks need a second workflow to post it.</p>
</article>
<article class="cl-outcome">
<div class="cl-outcome__art" aria-hidden="true">
Expand Down
17 changes: 10 additions & 7 deletions docs/why-cpp-linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ reports each take one input: pull request reviews with suggested fixes (`format-
(`thread-comments: update`), and the job step summary (`step-summary`).

Reviews and the comment need `GITHUB_TOKEN` with `pull-requests: write`. Pull requests from forks
get a read-only token: annotations still work, reviews are not posted, and `thread-comments` fails
the step. Since v2.23.0, `auto-fix: true` with `contents: write` commits the clang-format fixes to
the branch of a pull request from the same repository.
get a read-only token: annotations still work, reviews and the comment are not posted. The
[PR comments from forks](https://cpp-linter.github.io/cpp-linter-action/examples/) recipe posts the comment from a
second workflow. Since v2.23.0, `auto-fix: true` with `contents: write` commits the clang-format
fixes to the branch of a pull request from the same repository.

Only the files changed in the pull request are checked unless you set `files-changed-only: false`,
and `lines-changed-only: true` drops clang-tidy findings outside the changed lines. That is how a
Expand Down Expand Up @@ -57,7 +58,7 @@ header links to verify a cell. ✓ yes · ✗ no · — not applicable.
| File annotations | ✓ (10 per step) | ✗ | ✗ | ✓ instead of the review (10 max) | ✗ | ✗ | — |
| Thread comment, updated per push | ✓ | ✗ | ✗ | LGTM only | ✗ | ✓ | — |
| Job step summary | ✓ | on failure | ✗ | timings only | ✗ | ✗ | — |
| Reviews or comments on fork PRs | annotations only | — | — | ✓ split workflow | ✓ `workflow_run` | ✓ `pull_request_target` | — |
| Reviews or comments on fork PRs | comment via [`workflow_run`](https://cpp-linter.github.io/cpp-linter-action/examples/), no review | — | — | ✓ split workflow | ✓ `workflow_run` | ✓ `pull_request_target` | — |
| Only changed files / lines | ✓ both | ✗ | ✗ | ✓ diff | changed lines only | ✓ lines | staged files |
| Choose the LLVM version | [12–23, a path, or the runner's](https://cpp-linter.github.io/cpp-linter-action/inputs-outputs/#version) | 3–22 | 5–20 | 14, 17–21 | — | ✗ | via `rev` |
| Installs the tools itself | ✓ | Docker run | Docker | Docker (2–3 min build) | ✗ | Docker | ✓ wheel |
Expand Down Expand Up @@ -88,7 +89,8 @@ platisd/clang-tidy-pr-comments does exactly that step, and nothing else.

cpp-linter does not run cppcheck; JacobDomagala/StaticAnalysis runs it next to clang-tidy. If most
pull requests come from forks, clang-tidy-review's split workflow or clang-tidy-pr-comments'
`workflow_run` recipe can post reviews on them, while cpp-linter-action shows annotations only. If
`workflow_run` recipe can post reviews on them; cpp-linter-action's
[recipe](https://cpp-linter.github.io/cpp-linter-action/examples/) posts the comment, not a review. If
you lint many languages through one framework, reviewdog or MegaLinter fit better; neither ships
clang-tidy support, and MegaLinter's C/C++ linters are clang-format, cpplint and cppcheck.

Expand Down Expand Up @@ -148,8 +150,9 @@ into review suggestions and needs `pull-requests: write`.
```

The review comes from the same step, without waiting for a Docker image to build, and a new one
is posted on each push. Keep `pull-requests: write` on the job. Pull requests from forks get
annotations only; if most of yours come from forks, stay with the split workflow.
is posted on each push. Keep `pull-requests: write` on the job. Pull requests from forks get no
review; the [PR comments from forks](https://cpp-linter.github.io/cpp-linter-action/examples/) recipe posts the
comment instead. If you need review suggestions on fork pull requests, stay with the split workflow.

### From pre-commit/mirrors-clang-format

Expand Down