Skip to content

ci: show Cora Review findings in the job log, annotations and summary - #748

Merged
ajianaz merged 1 commit into
developfrom
ci/cora-review-readable-findings
Nov 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
ci/cora-review-readable-findings

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

A new step in the Cora Review workflow runs after the review action, also when the action fails. It reads cora-results.sarif and:

  • prints each finding as an ::error or ::warning workflow command, so it shows in the job log and as an annotation on the PR;
  • writes a table of the findings to the job summary;
  • shows at most 30 findings and says how many were left out.

The text is escaped for workflow commands and for Markdown tables, only the first line of a message goes into the annotation, and the script runs with python3 -I so nothing in the PR checkout can be imported. It posts no comment and uses no token.

Why

On a failed review the log only says how many findings blocked the job; the findings go to Code Scanning. They could not be read from the log, the job summary, the checks API or an artifact, which cost several fix attempts on a recent PR. A comment was not used on purpose: this job runs on pull_request_target and the SARIF text derives from untrusted PR code. Closes #747.

Testing

  • The script was run on a SARIF sample with a multi-line message that tries to inject a workflow command and a table break (::error::, %0A, |): the annotation carries only the first line, and the table cell is escaped. A finding without a location prints no file=; a missing SARIF file exits 0.
  • The workflow YAML parses, and the script extracted from the step runs unchanged.
  • Not exercised in CI by this PR: pull_request_target runs the workflow from develop, so the new step first runs on the next PR after this one is merged.
  • cora review --base origin/develop: no issues.

…#747)

The review action only prints how many findings blocked the job; the findings
themselves went to Code Scanning, so a failed review could not be read from the
log, the job summary or the checks API.

A step after the action, running even when the action fails, now reads the
SARIF and prints each finding as an error or warning workflow command (log and
PR annotation) and as a table in the job summary, capped at 30 findings. The
text is escaped for workflow commands and Markdown tables, only the first line
of a message is used for the annotation, and the script runs in isolated mode so
nothing in the PR checkout can be imported. It posts no comment and uses no
token, since the text derives from untrusted PR code on pull_request_target.
@ajianaz
ajianaz merged commit bb5c137 into develop Nov 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: make Cora Review findings readable from the job log and summary

1 participant