-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Summary
Hi.
golangci-lint correctly detects issues, but reviewdog does not create any PR reports/comments in any filter_mode.
-
In
nofilter, reviewdog prints all lint results to the GitHub Actions log
and CI fails, but still no PR comments are created. -
In all other filter modes (
added,diff_context,file):- CI does not fail
- reviewdog produces no output
- reviewdog creates no PR comments
My expected behavior is:
- In
filter_mode: added, reviewdog reports only issues on added/modified lines. - Reviewdog creates PR comments (github-pr-review).
- CI fails when lint errors exist on added/modified lines.
Currently none of these behaviors work.
This is not a permissions issue — my workflow explicitly grants:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions
permissions:
checks: write
contents: read
pull-requests: writeRepository structure (simplified):
repo-root/
.golangci.yml
app/
go.mod
Workflow:
- uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.HOGE_TOKEN }}
workdir: app
golangci_lint_flags: "--config=../.golangci.yml ./... --timeout=5m"
fail_level: warning
reporter: github-pr-review
filter_mode: <varies>
go_version_file: app/go.modReference for filter_mode:
https://github.com/reviewdog/action-golangci-lint?tab=readme-ov-file#filter_mode
Behavior of each filter_mode
filter_mode: added
- CI does not fail
- No PR reports
- No lint issues detected
log (simplified)
Running golangci-lint...
31 issues:
* errcheck: 11
* gocognit: 1
* gocritic: 1
* gofmt: 3
* prealloc: 1
* staticcheck: 7
* unparam: 1
* usetesting: 5
* whitespace: 1
Running reviewdog 🐶 ...
/home/runner/work/_temp/reviewdog-iCwcu0/reviewdog -f=golangci-lint -name=golangci -reporter=github-pr-review -filter-mode=added -fail-level=warning -fail-on-error=false -level=error
filter_mode: diff_context
- CI does not fail
- No PR reports
- No lint issues detected
The logs are almost identical to the ones shown in the filter_mode: added case, except for the filter_mode value.
filter_mode: file
- CI does not fail
- No PR reports
- No lint issues detected
The logs are almost identical to the ones shown in the filter_mode: added case, except for the filter_mode value.
filter_mode: nofilter
- CI fails (expected)
- Still no PR reports
- reviewdog logs show all lint issues
- Warning about “too many annotations” appears
- No PR reports created
Conclusion
- golangci-lint itself works correctly.
- reviewdog does not generate PR reports/comments for any filter_mode in this repository layout (Go module under app/).
- Only nofilter shows lint output, but still does not produce PR comments.
- It seems like reviewdog may be failing to match file paths against PR diffs, causing all non-nofilter modes to drop results.
- If there's any additional information I can provide, I'm happy to help debug this!
- I want to use filter_mode: added.