fix(ci): CI 固定 Go 1.22 低于 go.mod 要求的 1.26.1,改用 go-version-file 跟随 go.mod #419

Merged
wbtiger merged 2 commits from Taoyouce/gitlink-cli:fix/ci-go-version into master 2026-07-14 22:22:42 +08:00
Contributor

问题

.gitea/workflows/ci.yml.github/workflows/release.yml 中 setup-go 固定 go-version: '1.22',而 go.mod 已声明 go 1.26.1——低于模块要求的工具链会直接构建失败(go.mod requires go >= 1.26.1),即 CI/发布流水线与代码库实际要求脱节。仓库内 .github/workflows/test.yml 已经采用了正确写法(go-version-file: go.mod),本 PR 将其余两处对齐。

修复

两个 workflow 的 setup-go 均改为:

- uses: actions/setup-go@v5
  with:
    go-version-file: go.mod

此后 Go 版本随 go.mod 单一事实来源自动跟随,未来升级 Go 无需再改 CI 配置。2 行改动,零功能风险。

## 问题 `.gitea/workflows/ci.yml` 与 `.github/workflows/release.yml` 中 setup-go 固定 `go-version: '1.22'`,而 `go.mod` 已声明 `go 1.26.1`——低于模块要求的工具链会直接构建失败(`go.mod requires go >= 1.26.1`),即 CI/发布流水线与代码库实际要求脱节。仓库内 `.github/workflows/test.yml` 已经采用了正确写法(`go-version-file: go.mod`),本 PR 将其余两处对齐。 ## 修复 两个 workflow 的 setup-go 均改为: ```yaml - uses: actions/setup-go@v5 with: go-version-file: go.mod ``` 此后 Go 版本随 go.mod 单一事实来源自动跟随,未来升级 Go 无需再改 CI 配置。2 行改动,零功能风险。
Taoyouce added 6 commits 2026-07-11 00:32:31 +08:00
Taoyouce added 1 commit 2026-07-11 01:26:09 +08:00
9b4f890208 fix(ci): CI 安装 golangci-lint 并修复 make lint 全部 11 处报告(errcheck/gosec/misspell)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
wbtiger merged commit bced605f81 into master 2026-07-14 22:22:42 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#419
No description provided.