Skip to content

Skip uploading results to GH if no information#1269

Merged
attiasas merged 4 commits intojfrog:devfrom
attiasas:no_results_no_upload
Apr 23, 2026
Merged

Skip uploading results to GH if no information#1269
attiasas merged 4 commits intojfrog:devfrom
attiasas:no_results_no_upload

Conversation

@attiasas
Copy link
Copy Markdown
Contributor

Fix(github): skip Code Scanning SARIF upload when scan results have no information

Description

GitHub’s Code Scanning SARIF upload endpoint returns HTTP 400 with Invalid SARIF document: Empty sarif file provided when the payload is effectively empty (for example SARIF with "runs": []). That can happen when no SCA components are found and there is nothing meaningful to report, which led Frogbot to attempt an upload anyway and surface a warning/failure despite there being no findings.

This change short-circuits UploadRepoSarifResultsToGithubSecurityTab when scanResults is nil or scanResults.HasInformation() is false, so Frogbot does not generate or upload SARIF in those cases and logs that the GitHub Security Tab upload was skipped.

Changes

  • utils/utils.go: At the start of UploadRepoSarifResultsToGithubSecurityTab, return early (with an info log) when there is no scan information, before generateFrogbotSarifReport and the GitHub upload run.

@attiasas attiasas requested a review from a team April 14, 2026 10:14
@attiasas attiasas added bug Something isn't working safe to test Approve running integration tests on a pull request labels Apr 14, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Apr 14, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 19, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Apr 19, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 23, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Apr 23, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 23, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@attiasas attiasas merged commit 5a2cedd into jfrog:dev Apr 23, 2026
22 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants