Skip to content

Commit 06bf3de

Browse files
authored
docs: point fork PR notes to the PR comments from forks recipe (#112)
The site still said pull requests from forks get annotations only, and that `thread-comments` fails the step. Both are out of date: - The action docs have a [PR comments from forks](https://cpp-linter.github.io/cpp-linter-action/examples/) recipe (two workflows, `workflow_run`) that posts the comment. It does not post reviews. - Without it, the comment is not posted and the log shows a 403; the step does not fail. Updated the comparison row, the "what the action does" and "when another tool fits" notes, the migration note in `why-cpp-linter.md`, the fork line in `getting-started.md`, and the thread-comment card on the home page.
1 parent 3b81326 commit 06bf3de

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎docs/getting-started.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ jobs:
5454
both. `auto-fix` commits the clang-format fixes to the branch and needs `contents: write`.
5555
- The action does not fail the job by itself; the last step does, using the `checks-failed`
5656
output.
57-
- Pull requests from forks get a read-only token: annotations still appear, but reviews are not
58-
posted, and `thread-comments` would fail the step. Draft pull requests get no review.
57+
- Pull requests from forks get a read-only token: annotations still appear, but reviews and
58+
`thread-comments` are not posted. The [PR comments from forks](https://cpp-linter.github.io/cpp-linter-action/examples/) recipe
59+
posts the comment from a second workflow. Draft pull requests get no review.
5960

6061
The [action docs](https://cpp-linter.github.io/cpp-linter-action/) list every input, output and
6162
permission. [Moving to cpp-linter](blog/posts/2026-09-12-moving-to-cpp-linter.md) shows a

‎docs/overrides/home.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ <h3 class="cl-h3">Annotations</h3>
324324
<h3 class="cl-h3">Thread Comment</h3>
325325
<code class="cl-inline-code">thread-comments</code>
326326
</div>
327-
<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>
327+
<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>
328328
</article>
329329
<article class="cl-outcome">
330330
<div class="cl-outcome__art" aria-hidden="true">

‎docs/why-cpp-linter.md‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ reports each take one input: pull request reviews with suggested fixes (`format-
1919
(`thread-comments: update`), and the job step summary (`step-summary`).
2020

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

2627
Only the files changed in the pull request are checked unless you set `files-changed-only: false`,
2728
and `lines-changed-only: true` drops clang-tidy findings outside the changed lines. That is how a
@@ -57,7 +58,7 @@ header links to verify a cell. ✓ yes · ✗ no · — not applicable.
5758
| File annotations | ✓ (10 per step) | ✗ | ✗ | ✓ instead of the review (10 max) | ✗ | ✗ | — |
5859
| Thread comment, updated per push | ✓ | ✗ | ✗ | LGTM only | ✗ | ✓ | — |
5960
| Job step summary | ✓ | on failure | ✗ | timings only | ✗ | ✗ | — |
60-
| Reviews or comments on fork PRs | annotations only | — | — | ✓ split workflow | ✓ `workflow_run` | ✓ `pull_request_target` | — |
61+
| 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` | — |
6162
| Only changed files / lines | ✓ both | ✗ | ✗ | ✓ diff | changed lines only | ✓ lines | staged files |
6263
| 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` |
6364
| Installs the tools itself | ✓ | Docker run | Docker | Docker (2–3 min build) | ✗ | Docker | ✓ wheel |
@@ -88,7 +89,8 @@ platisd/clang-tidy-pr-comments does exactly that step, and nothing else.
8889

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

@@ -148,8 +150,9 @@ into review suggestions and needs `pull-requests: write`.
148150
```
149151

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

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

0 commit comments

Comments
 (0)