dominikh/Staticcheck
Run Staticcheck on your Go code
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Mar 4, 2026
- License
- MIT
Pinned Snippet
uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| version | The version of Staticcheck to use. Because new versions of Staticcheck introduce new checks that may break your build, it is recommended to pin to a specific version and to update Staticheck consciously. | yes | latest |
| min-go-version | Minimum version of Go to support. This affects the diagnostics reported by Staticcheck, avoiding suggestions that are not applicable to older versions of Go. If unset, this will default to the Go version specified in your go.mod. See https://staticcheck.io/docs/running-staticcheck/cli/#go for more information. | no | module |
| build-tags | Build tags | no | — |
| checks | Value to pass to Staticcheck in the -checks flag. This doesn't normally need to be set. | no | inherit |
| install-go | Let the action install the latest version of Go. If set to false, the action expects you to have installed Go already. The latest release of Staticcheck works with the last minor release of Go at that time. The action itself requires at least Go 1.16. | yes | true |
| use-cache | If set to true (the default), this action will automatically save and restore Staticcheck's cache using the actions/cache action. | no | true |
| cache-key | String to include in the cache key, in addition to the default, which is runner.os. This is useful when using multiple Go versions. | no | — |
| working-directory | Relative path to the working directory Staticcheck should be executed in. This is useful when dealing with multiple projects within one repository. | no | . |
| output-format | Output format to use. This corresponds to Staticcheck's -f flag. Usually you will want to use the default ("text"), as this format creates annotations on pull requests. When combining multiple runs with merge-files, you want to use the "binary" format on the individual runs to create the inputs to the merge run. | no | text |
| output-file | File to write Staticcheck's output to. Defaults to stdout. | no | — |
| merge-files | A newline-separated list of files to pass to "staticcheck -merge". | no | — |
Outputs
no outputs