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

Open
#3,383 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
ci-cd

Research direction

Start in src/git-utils.ts at the referenced line and compare its behavior with the linked workflow log. Trace why a missing repository causes repeated git calls during upload-sarif, then verify that the action still uploads SARIF successfully without repeatedly issuing those calls when no repository is checked out.

Written by the indexing model from the issue text.

Description

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...).

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.