Repository navigation
ci: manual backfill mode for the PR malware scan - #181
Merged
Merged
Conversation
PRs opened before the scanner went live have no Malware scan result, so the new required check blocks them until their author pushes. A workflow_dispatch run (prs: all, or a list of numbers) now scans those PRs and records a Malware scan commit status on each head, which satisfies the required check. Also useful for re-scanning after a rule change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Malware scan: passed, with notes for the reviewerNothing malicious was detected in
|
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 changed
Adds a
workflow_dispatchtrigger topr-malware-scan.yml, with inputsprs(all, or space-separated PR numbers) anddry_run, plus abackfill()entry point inpr-malware-scan.cjs.Why
Malware scanbecame a required check today, but it only runs when a PR is opened or pushed to. PRs opened before the scanner existed have no result, so they're blocked until their author pushes. Backfill scans them now, and is reusable after any rule change.How it works
For each open PR it runs the same scan, posts or updates the usual comment and
security-reviewlabel, and records aMalware scancommit status on the PR's head commit:successif clean,failureif there are HIGH findings. That status satisfies the required check exactly like the check run a normal push produces. Unknown or closed PR numbers are skipped, and a PR whose scan errors gets no status, so it's retried later rather than wrongly passed.Security
The trust model is unchanged: the PR is read only as data through the API, and nothing from it is checked out or executed. The only new permission is
statuses: write. Dispatch inputs reach the script throughenv, never${{ }}interpolation into code. Only users with write access can triggerworkflow_dispatch.Testing
Dry-ran backfill locally over all 58 open escrow PRs, with writes stubbed out (about 2 minutes). The results match the earlier full-repo testing: escrow #183 is clean, and HIGH findings appear only on the 7 known PRs (#137, #138, #175, #176, #182, #201, #202). A nonexistent number and a merged PR (#203) are skipped without aborting the run.
After merging
Go to Actions → PR malware scan → Run workflow with
prs: all, or I can trigger it.Which ROADMAP.md item does this close/progress?
Extends the existing malware-scan item in
ROADMAP.md.🤖 Generated with Claude Code