Skip to content

Fix report step crashing on runs with no pull request - #4

Merged
ralyodio merged 1 commit into
masterfrom
fix-report
Aug 1, 2026
Merged

Fix report step crashing on runs with no pull request#4
ralyodio merged 1 commit into
masterfrom
fix-report

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

First live run 30682540667 failed at Parse results and post PR comment:

generate-report.py: error: argument --pr-number: invalid int value: ''

On workflow_dispatch/push there 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

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>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

ThreatCrush scan results

0 finding(s) from threatcrush.

Severity Count
0

Detection coverage — FAIL

Metric Result
True positive rate 0.0% (0/77)
False positive rate 0.0% (0/39)
Missed detections 77

Every file under vulns/ contains intentional vulnerabilities used to
measure scanner accuracy. Findings there are the expected outcome, not a
regression. See docs/VULNERABILITY_CATALOG.md.

Posted by scripts/generate-report.py.

@ralyodio
ralyodio merged commit 11f0350 into master Aug 1, 2026
3 of 4 checks passed
@ralyodio
ralyodio deleted the fix-report branch August 1, 2026 03:45
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>
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.

2 participants