You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add opt-in inline PR review comments to Opengrep action (#20)
Post SAST findings as inline review comments on PRs when
pr-comments: 'true' is set (requires pull-requests: write).
Uses gh CLI for API calls with automatic pagination and auth.
Deduplicates across runs via fingerprint markers in HTML comments.
Falls back to a plain PR comment (with update-in-place dedup)
when inline review fails.
| `pr-comments` | `false` | Post findings as inline PR review comments (opt-in, see below). |
22
23
23
24
## Outputs
24
25
@@ -45,6 +46,28 @@ The action writes a GitHub job summary with:
45
46
46
47
New findings also appear as `::error::` annotations inline on the PR diff.
47
48
49
+
## PR review comments
50
+
51
+
Set `pr-comments: 'true'` to post findings as inline review comments directly on the PR diff, similar to Semgrep's managed scans. This requires `pull-requests: write` permission:
Comments are deduplicated across runs using the finding fingerprint — re-running the action on the same PR won't create duplicate comments. Each comment includes suppression guidance. Multi-line findings highlight the full matched range in the diff.
66
+
67
+
When a finding is fixed, the action strikes through the original comment and attempts to resolve the review thread. Thread resolution requires a GitHub App token or PAT — the default `GITHUB_TOKEN` can update the comment body but cannot resolve threads via GraphQL (`Resource not accessible by integration`).
68
+
69
+
When a finding's line isn't part of the diff (edge case), the action falls back to a single PR comment with a table of findings and clickable links. This fallback comment is updated in-place on subsequent runs to avoid notification noise.
0 commit comments