Error while uploading SARIF file using action github/codeql-action/upload-sarif

未关闭
#2,456 8 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
github-actions, typescript
领域
ci-cd, security

调研方向

首先检查 trivy_report.sarif 和 upload-sarif@v3 的处理输出,重点关注错误所引用的 artifact location 数据。将 SARIF 结构与链接的 SARIF 支持文档进行比较,并确定哪个 location 被拒绝。完成的标准是报告被接受,并在 code scanning 中完成处理且不出现 locationFromSarifResult 失败。

由索引模型根据 Issue 内容生成。

描述

Hello expert,
I am trying to upload a SARIF file generated by a trivy scan. Whereas the SARIF file is generated, the upload of the file in the security tab failed with the message:

Run github/codeql-action/upload-sarif@v3
  with:
    sarif_file: trivy_report.sarif
    checkout_path: /home/runner/work/aws-htc-grid/aws-htc-grid
    token: ***
    matrix: null
    wait-for-processing: true
  env:
    TRIVY_REPORT_FILE: trivy_report.sarif
    ACTIONS_STEP_DEBUG: true
Uploading results
  Processing sarif files: ["trivy_report.sarif"]
  Validating trivy_report.sarif
  Combining SARIF files using the CodeQL CLI
  Adding fingerprints to SARIF file. See https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs for more information.
  Uploading results
  Successfully uploaded results
Waiting for processing to finish
  Analysis upload status is pending.
  Analysis upload status is failed.
Error: Code Scanning could not process the submitted SARIF file:
locationFromSarifResult: expected artifact location

Do you have any clues what could be wrong with my SARIF files or how to improve observability of the action ?

主要语言
TypeScript
星标
1.6k
派生
493
平均合并
1 天 13 小时
30 天内合并 PR
44

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。