Files
dotnet-migrate/.gitea/ai-review/findings.json
T
2026-05-12 10:42:32 +00:00

24 lines
2.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[
{
"level": "critical",
"role": "Leo",
"location": ".gitea/workflows/review.yaml:13",
"suggestion": "將 `GEMINI_API_KEY` 參數中串接 20 個 API 金鑰的方式進行重構。這種寫法極度冗長,難以閱讀、維護和除錯。如果 Gitea Action 支援多個金鑰,應考慮使用更結構化的方式傳遞(例如,如果 Action 支援 YAML 列表或單一包含所有金鑰的 Secret)。如果 Action 預期單一金鑰,則此配置可能導致錯誤。建議與 Action 的開發者確認其支援的多金鑰機制,或考慮在 Action 內部處理金鑰輪替邏輯,以簡化工作流程配置。",
"is_new": true
},
{
"level": "critical",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:18-20",
"suggestion": "新建立的 `review.yaml` 工作流程賦予 `code-review` action 過於寬泛的權限,特別是 `contents: write`。這允許該 action 修改程式碼庫內容,若 action 存在漏洞或被惡意利用,可能導致程式碼注入、竄改或刪除。請重新評估 `code-review` action 所需的最小權限。如果僅需評論 PR`pull-requests: write` 和 `issues: write` 可能已足夠,但仍需謹慎。建議限制為只讀權限,或僅授予評論 PR 的權限,並確保 action 不會執行不必要的寫入操作。",
"is_new": true
},
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/master.yaml:13\n.gitea/workflows/review.yaml:12",
"suggestion": "兩個工作流程都使用了來自 `https://gitea.jsc.idv.tw` 的外部 action (`calculate-version` 和 `code-review`)。這引入了供應鏈風險,因為這些 action 的安全性直接影響到整個 CI/CD 流程。如果 `gitea.jsc.idv.tw` 受到損害,或這些 action 包含惡意程式碼,可能會導致嚴重的安全問題。建議對這些外部 action 的原始碼進行嚴格審查,確保其安全性,並考慮將其託管在內部或使用更受信任的來源。同時,確保使用固定的版本號(例如 `v1.2.3` 而非 `main` 或 `latest`)來避免意外的行為變更。",
"is_new": true
}
]