Hysen Labs
Open-source project
reviewdog/action-golangci-lint avatar
reviewdog

action-golangci-lint

Run golangci-lint with reviewdog

243 stars46 forksTypeScriptMIT
DEEP OPEN-SOURCE ANALYSIS

Reviewdog action runs golangci-lint on pull requests

This GitHub Action runs golangci-lint with reviewdog on pull requests to surface lint findings as review comments and checks.

What the action does

The reviewdog action for golangci-lint is a GitHub Action that runs golangci-lint together with reviewdog on pull requests to improve the code review experience. The README explains that golangci-lint performs the static analysis while reviewdog formats the results and posts them where reviewers can see them. The action is published by the reviewdog organization, and the README shows example annotations on the diff tab, the checks tab, and the status check view so readers can see how findings appear in a pull request. The core value is that lint problems show up as review comments or status checks instead of being buried in workflow logs that a reviewer might miss. The README documents a migration from version 1 to version 2, noting that in many cases a user only changes the action reference from v1 to v2. With v2 the action sets up Go and caches Go modules automatically, so the older workflow steps that installed Go and cached modules are no longer needed and should be removed. The example workflow checks out the code with fetch depth zero and then runs the action at a pinned commit reference. The README presents this as a drop in improvement rather than a rewrite, which lowers the cost of upgrading existing workflows that already rely on golangci-lint.

Inputs and configuration

The README documents a set of inputs that control how the action behaves. The github_token input is required and defaults to the automatic workflow token. The golangci_lint_flags input passes extra flags to the underlying golangci-lint run, and the tool_name input sets the reporter name, which is useful when several actions run with different configs. The level input maps to reviewdog's info, warning, or error levels, and the reporter input chooses between github-pr-check and github-pr-review. The filter_mode input selects added, diff_context, file, or nofilter, with added as the default. The fail_level input decides the exit code: when set to none the action always exits zero, and otherwise it exits one if it finds at least one issue at or above the given level. Other inputs cover workdir, reviewdog_flags, go_version, go_version_file, cache, reviewdog_version, and golangci_lint_version. The README notes that fail_on_error is deprecated in favor of fail_level. These inputs give a project fine control over how strict the gate is and where results appear. A team can keep lint as a non blocking comment by using fail_level none, or turn it into a required check by choosing a higher fail level. The documentation is essentially a reference of every supported input. It covers the most common tuning needs without requiring a separate config file for basic use.

Usage examples and versions

The README provides minimum, advanced, and all in one usage examples as YAML workflow snippets. The minimum example checks out the code and runs the action at a pinned commit, which is the smallest setup that produces lint feedback on a pull request. The advanced example shows several jobs that each run the action with a different linter enabled through golangci_lint_flags, such as golint with a warning level, errcheck with an info level, and a disabled cache variant. These examples demonstrate that a project can run multiple linters through the same action by passing disable all and then enabling a single linter, and that the tool_name input keeps each report distinct. The all in one example passes enable all with exclude use default false to exercise the full linter set without a config file. Across the examples the action is pinned to a specific commit hash rather than a moving tag, which is the recommended practice for supply chain safety. The README shows badges for the release workflow and for the latest semantic version, and it references a used by counter. With 243 stars in the metadata, the action is a reasonably popular piece of the Go continuous integration tooling, and the v2 redesign that removes the need for manual Go setup makes it simpler to add to a repository than the previous version was.

Editorial conclusion

The action is distributed under the MIT license and its most recent commit was on 2026-08-26.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes