upload-sarif: `git call failed.` more times than necessary for a working directory without a git repository

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
ci-cd

调研方向

从引用的行开始检查 src/git-utils.ts,并将其行为与链接的 workflow 日志进行比较。追踪缺少 repository 为何会在 upload-sarif 期间导致重复调用 git,然后验证在没有 checkout 任何 repository 时,该 action 仍能成功上传 SARIF,且不会重复发出这些调用。

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

描述

https://github.com/github/codeql-action/blob/f67ec12472e1b361f5e1e2085f5e6f85a57e3cd6/src/git-utils.ts#L87

https://github.com/check-spelling-sandbox/skipper/actions/runs/20649925837/job/59292941788

Run github/codeql-action/upload-sarif@7434149006143a4d75b82a2f411ef15b03ccc2d7
git call failed. Continuing with commit SHA from user input or environment. Error: The checkout path provided to the action does not appear to be a git repository.
Uploading code scanning results
  Processing sarif files: ["cifuzz-sarif/results.sarif"]
  Validating cifuzz-sarif/results.sarif
  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.
  (node:12002) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
  (Use `node --trace-deprecation ...` to show where the warning was created)
  git call failed. Continuing with commit SHA from user input or environment. Error: The checkout path provided to the action does not appear to be a git repository.
  git call failed. Continuing with commit SHA from user input or environment. Error: The checkout path provided to the action does not appear to be a git repository.
  git call failed. Will calculate the base branch SHA on the server. Error: The checkout path provided to the action does not appear to be a git repository.
  Uploading results
  Successfully uploaded results
Waiting for processing to finish
git call failed. Continuing with commit SHA from user input or environment. Error: The checkout path provided to the action does not appear to be a git repository.

Ideally, the action should be able to "quickly" determine that there isn't a repository checked out and not waste additional time running git commands.

Note that this flow (using google/clusterfuzzlite/actions/run_fuzzers and then ideally uploading sarif output) is a flow that people expect to be able to do (yes, Google is missing documentation for how to do it, but...).

主要语言
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 摘要。