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
Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
Yes, I've searched similar issues on GitHub and didn't find any.
Yes, I've included all information below (version, config, etc).
Description of the problem
It looks like some version of golangci-lint can require a specific version of Go, which adds a line to the output when installing it, which makes the action use the wrong install path.
Here is part of the install output:
go: github.com/golangci/golangci-lint@v1.60.1 requires go >= 1.22.1; switching to go1.22.6
touch /home/runner/go/bin/golangci-lint
Installed golangci-lint into github.com/golangci/golangci-lint@v1.60.1 in 42821ms
core.info(`Installed golangci-lint into ${lintPath} in ${Date.now()-startedAt}ms`)
Changing the version in my go.mod file from 1.22.0 to 1.22 fixed it, but I believe the path should be correctly parsed by the action.
Version of golangci-lint
1.60.1
Version of the GitHub Action
v6 (latest)
Workflow file
```
jobs:
lint-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Using setup-go cache conflicts with golangci-lint action own cache management
cache: false
cache-dependency-path: go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: latest
# Optional: golangci-lint command line arguments.
args: --timeout=10m
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
# Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
install-mode: "goinstall"
</details>
### Golangci-lint configuration
<details>
```yml
run:
timeout: 5m
linters:
disable-all: true
enable:
- unused # Finds unused code
- unconvert # Remove unnecessary type conversions
- unused # Checks Go code for unused constants, variables, functions and types
- ineffassign # Detects when assignments to existing variables are not used
- misspell # Finds commonly misspelled English words in comments
- gofmt # Gofmt checks whether code was gofmt-ed
- revive # Revive is a replacement for golint, a coding style checker
- errcheck # errcheck is a program for checking for unchecked errors in go programs.
- staticcheck # staticcheck is a go vet on steroids, applying a ton of static analysis checks
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- bodyclose # checks whether HTTP response body is closed successfully
- exhaustive # check exhaustiveness of enum switch statements
- stylecheck # Stylecheck is a replacement for golint
linters-settings:
errcheck:
# Disable warnings for `fmt` and `log` packages.
exclude-functions:
- fmt.Errorf
- fmt.Print
- fmt.Printf
- fmt.Println
- (github.com/pulumi/pulumi/sdk/v3/go/pulumi.Log).Debug
- (github.com/pulumi/pulumi/sdk/v3/go/pulumi.Log).Info
- (github.com/pulumi/pulumi/sdk/v3/go/pulumi.Log).Warn
- (github.com/pulumi/pulumi/sdk/v3/go/pulumi.Log).Error
staticcheck:
checks: ["all"]
Go version
1.22.0
Code example or link to a public repository
// add your code here
The text was updated successfully, but these errors were encountered:
Welcome
Description of the problem
It looks like some version of golangci-lint can require a specific version of Go, which adds a line to the output when installing it, which makes the action use the wrong install path.
Here is part of the install output:
Full job output if needed https://github.com/DataDog/test-infra-definitions/actions/runs/10450688362/job/28935553314.
It was installed in
/home/runner/go/bin/golangci-lint
but was detected asgh.neting.cc/golangci/golangci-lint@v1.60.1
.This is due to the logic not expecting the first line
golangci-lint-action/src/install.ts
Lines 103 to 106 in de85310
Changing the version in my
go.mod
file from 1.22.0 to 1.22 fixed it, but I believe the path should be correctly parsed by the action.Version of golangci-lint
1.60.1
Version of the GitHub Action
v6 (latest)
Workflow file
Go version
1.22.0
Code example or link to a public repository
// add your code here
The text was updated successfully, but these errors were encountered: