Skip to content

[P2] Make findings unmissable even when the gate can't remediate: SARIF upload, report/patch artifacts, actionable step summary #10

Description

@Ndevu12

Severity

P2 (medium). Pure upside, lives entirely in the action — no scanner change required. Improves the "red gate, now what?" experience.

Context

When the scanner detects an infection it can't auto-fix (stayAwakeBot #1183/#1184/#1185), the job goes red and the operator digs through raw logs. The action already has the machine-readable report — it can put findings where a reviewer will see them.

Proposed (action-layer only)

  1. SARIF upload. saw scan --sarif <file> already emits SARIF 2.1.0; add an optional step to upload via github/codeql-action/upload-sarif → Security tab + inline annotation on the exact line (e.g. postcss.config.mjs:11).
  2. Artifacts. Upload the JSON report and any sab-patches/*.patch via actions/upload-artifact so evidence travels with the run.
  3. Actionable step summary. On infected/aborted, write the per-finding manual-review guidance (reason + command from stayAwakeBot #1184) to $GITHUB_STEP_SUMMARY, optionally a sticky PR comment.

Scope — general

Applies to any infected or aborted run, any finding category — not the motivating payload specifically.

Safety / correctness invariants (must NOT introduce mistakes)

  1. Additive only. These steps must never change the gate outcome — the verdict is decided before and independently of them.
  2. Least privilege. SARIF upload needs security-events: write; scope that to the upload step, keep the scan job contents: read, and don't blanket-grant. Document the minimum, don't recommend flipping the repo default token to read/write.
  3. Redact + escape. The summary/PR-comment path must reuse the scanner's evidence redaction and escape untrusted paths so a crafted filename can't inject markdown or ::-workflow commands into the summary (mirrors stayAwakeBot #1184). --sarif and -d reports are already redacted — keep it; never upload the raw infected file as an artifact (redacted report + fix patches only).
  4. Capability-probe. A missing --sarif/-d on an old pinned version must skip, not fail — consistent with the action's existing probing.
  5. Fork PRs degrade, don't fail. From a fork the token can't upload SARIF or comment; fall back to artifact-only and never fail the job for lack of permission.

Non-goal

Visibility only; does not touch gate semantics. Complements stayAwakeBot #1183/#1184.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions