Problem
fail_level appears to have no effect when all golangci-lint findings are
filtered out by filter_mode (default: added). This is especially confusing
because:
- The README recommends migrating from the deprecated
fail_on_error to
fail_level, implying it controls job failure.
- golangci-lint still produces
##[error] annotations in the job log via
stderr, so the user sees errors but the job succeeds.
Steps to reproduce
- action-golangci-lint version:
v2.10.0
- reviewdog version:
v0.21.0
- uses: reviewdog/action-golangci-lint@v2
with:
fail_level: warning
# filter_mode defaults to "added"
- golangci-lint finds issues on lines that already existed (not added in the PR).
- The CI log shows
##[error] annotations for each finding.
- The job still succeeds because reviewdog's
filter_mode: added filters out
all issues before fail_level is evaluated.
Root cause
In reviewdog.go,
ShouldFail is only evaluated for diagnostics where check.ShouldReport is
true (i.e., diagnostics that survive the filter_mode filter):
if !check.ShouldReport {
// skipped — never checked against failLevel
} else {
shouldFail = shouldFail || w.failLevel.ShouldFail(check.Diagnostic.GetSeverity())
}
So when filter_mode: added removes all findings, shouldFail stays false
and reviewdog exits 0 regardless of fail_level.
Suggestion
- Documentation: Clarify in the README that
fail_level only applies to
issues that pass the filter_mode filter, and that the default added mode
may silently suppress all failures.
- UX (optional): Consider logging a warning when golangci-lint reports
issues but all are filtered out, so users understand why the job succeeded
despite ##[error] annotations in the log.
Problem
fail_levelappears to have no effect when all golangci-lint findings arefiltered out by
filter_mode(default:added). This is especially confusingbecause:
fail_on_errortofail_level, implying it controls job failure.##[error]annotations in the job log viastderr, so the user sees errors but the job succeeds.
Steps to reproduce
v2.10.0v0.21.0##[error]annotations for each finding.filter_mode: addedfilters outall issues before
fail_levelis evaluated.Root cause
In
reviewdog.go,ShouldFailis only evaluated for diagnostics wherecheck.ShouldReportistrue (i.e., diagnostics that survive the
filter_modefilter):So when
filter_mode: addedremoves all findings,shouldFailstaysfalseand reviewdog exits 0 regardless of
fail_level.Suggestion
fail_levelonly applies toissues that pass the
filter_modefilter, and that the defaultaddedmodemay silently suppress all failures.
issues but all are filtered out, so users understand why the job succeeded
despite
##[error]annotations in the log.