CI: make Codacy SARIF upload resilient to empty runs#194
Merged
Conversation
Co-Authored-By: Warp <agent@warp.dev>
|
Merging to
|
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
👋 Development Partner is reviewing this PR. Will provide feedback shortly. |
Co-Authored-By: Warp <agent@warp.dev>
|
👋 Development Partner is reviewing this PR. Will provide feedback shortly. |
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent failures in the Codacy Security Scan workflow caused by GitHub's code scanning API rejecting SARIF files with empty runs arrays. The fix adds a normalization step that ensures at least one (empty) run entry exists in the SARIF output before upload.
Changes:
- Added a Python normalization script between the Codacy analysis and SARIF upload steps
- Script validates the SARIF file exists and contains valid JSON
- When
runsis missing or empty, inserts a minimal valid SARIF run entry to satisfy GitHub's API requirements - Preserves existing SARIF content when runs are already present
Co-Authored-By: Warp <agent@warp.dev>
|
👋 Development Partner is reviewing this PR. Will provide feedback shortly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codacy Security Scan has been intermittently failing at the SARIF upload step with:
The failing run showed github/codeql-action/upload-sarif@v3 attempting to upload results.sarif.
This PR adds a small normalization step that ensures the generated SARIF contains at least one runs entry before upload. GitHub code scanning rejects SARIF payloads with 0 runs, even when there are 0 findings.
SECURITY NOTE:
Co-Authored-By: Warp agent@warp.dev