Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/actions/cora-review-simple/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,29 @@
> cora-results.sarif 2>/dev/null
echo "Cora review complete ($(wc -c < cora-results.sarif) bytes)"

- name: Upload SARIF to GitHub Code Scanning
- name: Check SARIF for findings
id: sarif-check
if: inputs.upload-sarif == 'true'
shell: bash
run: |
RESULTS=$(python3 -c "
import json, sys
try:
data = json.load(open('cora-results.sarif'))
results = data.get('runs', [{}])[0].get('results', [])
print(len(results))
except:
print(0)
" 2>/dev/null || echo "0")
echo "results=$RESULTS" >> "$GITHUB_OUTPUT"
if [ "$RESULTS" -gt 0 ]; then
echo "SARIF contains $RESULTS finding(s) — will upload."
else
echo "SARIF has no findings — skipping upload."
fi

- name: Upload SARIF to GitHub Code Scanning
if: inputs.upload-sarif == 'true' && steps.sarif-check.outputs.results > 0
continue-on-error: true
uses: github/codeql-action/upload-sarif@v4
with:
Expand Down
23 changes: 22 additions & 1 deletion .github/actions/cora-review/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,29 @@
exit 1
fi

- name: Upload SARIF to GitHub Code Scanning
- name: Check SARIF for findings
id: sarif-check
if: inputs.upload-sarif == 'true'
shell: bash
run: |
RESULTS=$(python3 -c "
import json, sys
try:
data = json.load(open('cora-results.sarif'))
results = data.get('runs', [{}])[0].get('results', [])
print(len(results))
except:
print(0)
" 2>/dev/null || echo "0")
echo "results=$RESULTS" >> "$GITHUB_OUTPUT"
if [ "$RESULTS" -gt 0 ]; then
echo "SARIF contains $RESULTS finding(s) — will upload."
else
echo "SARIF has no findings — skipping upload."
fi

- name: Upload SARIF to GitHub Code Scanning
if: inputs.upload-sarif == 'true' && steps.sarif-check.outputs.results > 0
continue-on-error: true
uses: github/codeql-action/upload-sarif@f52b05f4acaaa234e44466e66d29050e135ea9ef # v4.36.0
with:
Expand Down
Loading