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

Open
#2,456 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
github-actions, typescript
Domain
ci-cd, security

Research direction

Start by inspecting trivy_report.sarif and the upload-sarif@v3 processing output, focusing on the artifact location data referenced by the error. Compare the SARIF structure with the linked SARIF support documentation and determine which location is rejected. Done means the report is accepted and finishes processing in code scanning without the locationFromSarifResult failure.

Written by the indexing model from the issue text.

Description

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 ?

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.