Repository navigation
fix: skip SARIF upload when no findings - #153
Merged
Merged
Conversation
…n PRs) Only upload SARIF to GitHub Code Scanning when the review actually found issues. This prevents the CodeCora check from showing as 'failed' on clean PRs where cora found no problems. The upload-sarif step now depends on a sarif-check step that parses the SARIF and outputs the findings count. The upload only runs when findings > 0. Co-Authored-By: codecoradev <noreply@github.com>
| " 2>/dev/null || echo "0") | ||
| echo "results=$RESULTS" >> "$GITHUB_OUTPUT" | ||
| if [ "$RESULTS" -gt 0 ]; then | ||
| echo "SARIF contains $RESULTS finding(s) — will upload." |
| " 2>/dev/null || echo "0") | ||
| echo "results=$RESULTS" >> "$GITHUB_OUTPUT" | ||
| if [ "$RESULTS" -gt 0 ]; then | ||
| echo "SARIF contains $RESULTS finding(s) — will upload." |
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (2)
Review powered by cora-cli · BYOK · MIT |
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.
Summary
CodeCora check shows ❌ fail on clean PRs because SARIF is always uploaded to GitHub Code Scanning — even when cora found zero issues.
Fix
Add a
sarif-checkstep before upload that parses SARIF and counts findings. Theupload-sarifstep now only runs whenfindings > 0:Behavior Change
Files Modified
.github/actions/cora-review/action.yml— add sarif-check + conditional upload.github/actions/cora-review-simple/action.yml— same fixCo-Authored-By: codecoradev noreply@github.com