Fix report step crashing on runs with no pull request - #4
Merged
Conversation
The first live run (30682540667, a workflow_dispatch) failed at 'Parse results
and post PR comment':
generate-report.py: error: argument --pr-number: invalid int value: ''
On workflow_dispatch and push events there is no pull request, so the workflow
interpolates an empty string and argparse's int converter aborted the step.
An absent PR is a normal state, not an error: write the summary, skip the
comment.
--pr-number is now a string, validated as digits, with each skip reason logged
distinctly (no PR / no --repo / no token) so a silent no-comment is always
explainable. Verified against all six paths: empty, omitted, non-numeric,
valid-without-token, and a populated SARIF that still renders.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush scan results0 finding(s) from
Detection coverage — FAIL
Every file under Posted by |
ralyodio
added a commit
that referenced
this pull request
Aug 1, 2026
workflow_dispatch and push events carry no PR number, so --pr-number received an empty string and argparse aborted the step. It is now a validated string, and an absent PR skips the comment rather than failing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
First live run 30682540667 failed at Parse results and post PR comment:
On
workflow_dispatch/pushthere is no PR, so the workflow passes an empty string and argparse aborted the step. An absent PR is normal — write the summary, skip the comment.Tested locally across all six paths: empty, omitted, non-numeric, valid-without-token, populated SARIF, and the full linter.
🤖 Generated with Claude Code