CI: pin GitHub Actions by commit SHA

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

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

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

研究方向

從 .github/workflows/ci.yml 開始,該檔案中有三行 uses: 固定在版本標籤上(actions/checkout、actions/setup-python、ilammy/msvc-dev-cmd)。在各自的上游儲存庫中查找每個標籤對應的 40 位提交 SHA,並按 uses: owner/action@<sha> # vX.Y.Z 的格式寫入。可選的 .github/dependabot.yml 以及授權和行尾檢查工作則是單獨的額外工作。當工作流程中的每個 action 引用都固定到 SHA,且 CI 執行仍然通過時,即完成。

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

描述

area: build-ci build

.github/workflows/ci.yml references its three actions by version tag (actions/[email protected], actions/[email protected], ilammy/[email protected]). A tag can be moved by whoever controls the action's repository; a commit SHA cannot.

The exposure is small (the workflow has contents: read, no secrets, and publishes nothing), but pinning by SHA is the usual hardening for a public repository that takes outside pull requests.

To do

  • Replace each tag with the 40-character commit SHA of that release, with the tag in a trailing comment (uses: actions/checkout@<sha> # v4.2.2).
  • Optionally add .github/dependabot.yml for the github-actions ecosystem so updates stay easy.
  • Optionally a line in the licence-and-line-endings job that fails when a workflow uses an action that is not pinned by SHA.
主要語言
C++
星號
12
分支
2
平均合併
3 小時 10 分鐘
30 天內合併 PR
171

環境準備

從這裡開始

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

phantoslayer21/wronggpu 的其他 Issue

查看 phantoslayer21/wronggpu 的全部 Issue

相似的 Issue

更多 C++ Issue

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

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