GoReleaser version floats on "~> v2" in the job that signs releases

未關閉 適合新手
#324 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
66/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, go, yaml
領域
ci-cd, release

研究方向

從 .github/workflows/go.yml 開始:第 249 行(snapshot)和第 331 行(release)的 goreleaser/goreleaser-action 步驟使用 version: "~> v2",發佈工作的權限位於第 286-289 行附近。選定一個確切的 GoReleaser 版本,並在發佈日誌中檢查目前解析到的版本。兩個步驟都指定該版本、儲存庫中記錄了如何升級該版本,且發佈工作的 checkout 設定了 persist-credentials: false,即為完成。升級方式由維護者決定,因此編輯前請先確認。

由索引模型根據 Issue 內容生成。

描述

area: release dependencies good first issue severity: low

Summary

Every action and build tool in the workflows is pinned except GoReleaser itself, which resolves to the newest 2.x at run time in both the snapshot and the release job.

Where

  • .github/workflows/go.yml:331
  • .github/workflows/go.yml:249
  • .github/workflows/go.yml:286

Details

Every action is pinned to a commit SHA, and golangci-lint (v2.15.0, go.yml:117), govulncheck (@v1.9.0, go.yml:123), syft and cosign (fixed by their pinned installer actions; the log shows syft v1.54.0) are fixed versions. GoReleaser itself is not: goreleaser/goreleaser-action@a4f02ab... # v7.3.0 is given version: "~> v2" at go.yml:249 (snapshot) and go.yml:331 (release). The release-snapshot log of run 43648865601 shows it resolved at run time: Downloading https://github.com/goreleaser/goreleaser/releases/download/v2.20.2/goreleaser_Linux_x86_64.tar.gz, checked only against checksums.txt from the same release. The release job holds contents: write, id-token: write and attestations: write (go.yml:286-289).

Impact

Whatever GoReleaser v2.x is newest on the day of a tag builds, signs and uploads the release, with nothing reviewed and no Dependabot PR. A new minor that changes or deprecates a config key fails or alters a release that the snapshot run on the previous push passed, and a compromised upstream release would run with the signing identity. It is the one build tool in the release path that is not reproducible from the repository.

Steps to reproduce

Compare go.yml:331 with the Downloading .../goreleaser/releases/download/v2.20.2/... line in job 132612931653's log.

Suggested fix

Pin an exact version (version: v2.20.2) in both steps, and keep it current by hand or with a Dependabot-visible form (a tools go.mod or a comment-driven updater such as Renovate's regex manager; Dependabot's github-actions ecosystem does not read with: version).

Notes

While here: the release job's checkout can set persist-credentials: false; GoReleaser and gh take the token from the environment.

Acceptance criteria

  • Both jobs name an exact GoReleaser version
  • There is a documented way to bump it
  • The release job's checkout does not persist credentials

Getting started

  • Relevant files: .github/workflows/go.yml
  • How to run tests: make test (or go test ./...). Tests must stay hermetic: use -simulate, -simulate-zone or the local DNS test server, never a live domain.
  • Related docs: docs/DEVELOPER_GUIDE.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at d0c56f0. Severity: low. Effort: S. audit-key: dependencies|.github/workflows/go.yml|goreleaser-action.version

主要語言
Go
星號
1
分支
1
平均合併
6 小時 42 分鐘
30 天內合併 PR
7

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/subenum 的其他 Issue

查看 TMHSDigital/subenum 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。