ci: 升级 GitHub Actions 到 Node 24 并修复 golangci-lint - #877
Draft
Colin-XKL wants to merge 1 commit into
Draft
Conversation
Node 20 actions are deprecated and being forced onto Node 24. Bump workflow actions to Node 24 runtimes, and switch golangci-lint to v2 so it can lint the Go 1.25.13 toolchain. Co-authored-by: Colin <Colin_XKL@outlook.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Reviewer's GuideThis PR updates GitHub Actions workflows to use Node 24–compatible action versions, fixes golangci-lint compatibility with the project’s Go toolchain, and adjusts the local lint task to match the CI configuration. Sequence diagram for updated lint workflow using install-only golangci-lintsequenceDiagram
actor Developer
participant GitHubActions
participant golangci_lint_action_v9
participant task_lint
participant golangci_lint_binary
Developer->>GitHubActions: push or PR triggers lint_workflow
GitHubActions->>golangci_lint_action_v9: uses golangci/golangci-lint-action@v9 version v2.12.2 install-only true
golangci_lint_action_v9-->>GitHubActions: golangci-lint v2.12.2 installed
GitHubActions->>task_lint: run task lint
task_lint->>golangci_lint_binary: golangci-lint run ./... --timeout=10m
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
近期
Lintworkflow 在dev上失败,同时 GitHub Actions 提示 Node.js 20 已弃用。Lint 失败根因:
golangci/golangci-lint-action@v6安装的仍是 golangci-lint v1.64.8(用 Go 1.24 构建)。项目go.mod的 toolchain 是go1.25.13,因此报错:Node 20 弃用: runner 已默认用 Node 24 强制执行仍声明
node20的 action,例如actions/checkout@v4、actions/setup-go@v5、golangci-lint-action@v6、docker/setup-buildx-action@v3、docker/metadata-action@v5。改动
checkout/setup-go/setup-node升到 v7(Node 24 runtime),前端 Node 版本改为24golangci-lint-action升到 v9,安装 golangci-lint v2.12.2(install-only),由task fix实际执行task lint为 golangci-lint 增加--timeout=10m验证
本 PR 上 GitHub Actions 已全部通过:
说明
github/ossar-action@v2仍声明 Node 20,暂无 Node 24 版本。其余 JavaScript action 均已切到using: node24。Summary by Sourcery
Update CI workflows to use Node 24-compatible GitHub Actions and align golangci-lint with the project Go toolchain.
CI:
Tests: