fix(ci): make Scorecard skip cleanly on private forks - #69
Conversation
Scorecard's publish + SARIF upload require a public repo; on a private fork they fail. Add a `visibility` guard job (resolves repo visibility via the API, which works on every trigger unlike the schedule event payload) and gate the analysis job on it, so a private fork skips cleanly instead of going red. Drops the stale "set false / delete on a private fork" guidance and updates the README checklist to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
318d4f1 to
2f1ad1b
Compare
Code ReviewFiles reviewed: 2 files across CI ( Overall a clean, correct fix. The visibility gate resolves repo visibility via the API — the only approach that works across all three triggers, since Critical IssuesNone found. Important IssuesNone found. Minor Issues
Suspected
SummaryApprove. The core fix is correct and well-commented, and the fail-safe genuinely fails green across all triggers. Every graded finding is Minor: Finding 1 and Finding 2 are comment/permission nits, and Finding 3 is an observability nicety. The Suspected item touches only the deliberate private-GHAS opt-out path and deserves a one-line verification before that guidance is relied on. Nice work. Generated by Claude — reply with /praxis:address-review 69 to work through findings |
- trim redundant inline comment on publish_results
- tighten visibility job to permissions: {} (metadata:read is always granted)
- case-split visibility check: silent skip on private/internal, warn only on
unresolved/API-failure so a transient public-repo blip is visible in the log
- note publish_results: false alongside "drop the gate" GHAS guidance
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Makes
scorecard.ymlskip cleanly on a private fork instead of failing its publish/SARIF upload (both require a public repo). Extracted from the closed CodeQL PR #68 — this is the one piece that stands on its own, independent of any CodeQL decision.Change
A small
visibilityguard job resolves repo visibility viagh api repos/$GITHUB_REPOSITORY --jq .visibility(the API works on every trigger;github.event.repositoryis absent onscheduleruns) and exposes it as an output. Theanalysisjob gates onneeds.visibility.outputs.public == 'true':analysisis skipped (green) — no failed upload, no manual deletion needed.Also drops the now-stale "delete the workflow if the repo is private" guidance (workflow header + README checklist) since deletion is no longer required.
Verification
run:), zizmor, check-yaml, and markdownlint all pass.gh apidegrades topublic=falseunder theif-test idiom, sovisibilitystays green andanalysisskips (confirmed in adversarial review).🤖 Generated with Claude Code