Repository navigation
ci: show Cora Review findings in the job log, annotations and summary - #748
Merged
Merged
Conversation
…#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.
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.
What
A new step in the Cora Review workflow runs after the review action, also when the action fails. It reads
cora-results.sarifand:::erroror::warningworkflow command, so it shows in the job log and as an annotation on the PR;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 -Iso 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_targetand the SARIF text derives from untrusted PR code. Closes #747.Testing
::error::,%0A,|): the annotation carries only the first line, and the table cell is escaped. A finding without a location prints nofile=; a missing SARIF file exits 0.pull_request_targetruns the workflow fromdevelop, so the new step first runs on the next PR after this one is merged.cora review --base origin/develop: no issues.