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

Đang mở Phù hợp với người mới
#324 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
66/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, go, yaml
Lĩnh vực
ci-cd, release

Hướng nghiên cứu

Bắt đầu từ .github/workflows/go.yml: các bước goreleaser/goreleaser-action ở dòng 249 (snapshot) và dòng 331 (release) dùng version: "~> v2", còn quyền của job release nằm quanh dòng 286-289. Chọn một phiên bản GoReleaser cụ thể và kiểm tra trong log release xem hiện tại nó đang resolve về phiên bản nào. Hoàn tất khi cả hai bước đều ghi phiên bản đó, repository có tài liệu hướng dẫn cách nâng phiên bản, và checkout của job release đặt persist-credentials: false. Cách nâng phiên bản là quyết định của maintainer, vì vậy hãy xác nhận trước khi chỉnh sửa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
1
Fork
1
Merge trung bình
6 giờ 42 phút
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/subenum

Tất cả issue của TMHSDigital/subenum

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.