-
-
Notifications
You must be signed in to change notification settings - Fork 165
Description
Welcome
- 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
When using Go 1.24.0's new feature to install golangci-lint, golangci-lint-action fails during execution. The failure is caused by an issue in the version inference mechanism that relies on the go.mod file, leading to incorrect version detection.
Steps to Reproduce:
- Set up a GitHub Actions workflow with Go 1.24.0.
- Install golangci-lint using the new installation method (e.g., go get -tool).
- Run golangci-lint-action.
- Observe that the action fails due to an error in inferring the version from the go.mod file.
Expected Behavior:
golangci-lint-action should accurately determine the installed golangci-lint version even when installed with Go 1.24.0's new installation approach, allowing the action to execute successfully.
Suggestion:
By revising the version inference logic in golangci-lint-action to accommodate Go 1.24.0's new installation method, the issue with incorrect version detection can be resolved. This adjustment would prevent execution failures in workflows using this Go version.
Reference Information:
Sample reproducing the issue: golangci-lint-action-124-gomod-tool-directive
Example of a failed GitHub Actions job: Failed Actions Job
Version of golangci-lint
1.64.4
Version of the GitHub Action
6.3.2
Workflow file
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout 5m
skip-pkg-cache: true
skip-build-cache: true
Golangci-lint configuration
nothing
Go version
1.24.0
Code example or link to a public repository
nothing