[upload-sarif@v3] action completely ignore the `sha` input and using commit hash from `checkout_path` instead
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- github-actions, typescript
研究方向
從 src/upload-sarif-action.ts 第 91 行和 src/upload-lib.ts 第 605 行開始,接著追蹤 sha 輸入和 checkout_path commit 的選取方式。使用 YAML 範例重現回報的上傳,並檢查請求本文。當上傳請求使用提供的 sha 作為 commit_oid 時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
- Usage:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/fix-paths-cpp.sarif
ref: refs/heads/main
sha: a8e616ed369f7f74173a13c5489dbae89c3b12
checkout_path: /runner/_work/parent-repo/build
- Output from action:
request: {
method: 'PUT',
url: 'https://github.com/api/v3/repos/PFO/OpenSIL/code-scanning/analysis',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'CodeQL-Action/3.22.12 octokit-core.js/3.6.0 Node.js/20.18.0 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"commit_oid":"b0b0efb3f489d6c16d35gsfd4b388173h99e1049","ref":"refs/heads/main","analysis_key":".github/workflows/codeql-nightly.yml:codeql","analysis_name":"CodeQL- Nightly","sarif":"..."}'
From the output, we can see that it is not actually uploading with the commit_oid that we assigned in the sha input.
Looking at the src code of the upload-sarif action:
- https://github.com/github/codeql-action/blob/main/src/upload-sarif-action.ts#L91
- https://github.com/github/codeql-action/blob/main/src/upload-lib.ts#L605
It is actually using the commit hash sha from the repo under thecheckout_path, which completely ignores theshainput in the action.
- 主要語言
- TypeScript
- 星號
- 1.7k
- 分支
- 495
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 47
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/codeql-action 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
github/codeql-action#4052 · 4 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
github/codeql-action#4185 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-action#4173 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
github/codeql-action#4078 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-action#4008 · 9 則留言 ·
維護者通常 1 天內回覆
查看 github/codeql-action 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆