Skip to content

fix(sarif): SARIF_HASH computed before test-sarif deletion; upload failures silently swallowed #855

Description

@credfeto

Found during AI review of all workflows/actions.

Problems (all in .github/actions/sarif/action.yml)

  1. Lines 17-21${{hashfiles('**/*.sarif')}} is evaluated when the step starts, i.e. before the rm -rf *.Tests.sarif on the previous line takes effect. If the only sarif files were test ones, SARIF_HASH is non-empty and the upload runs on an effectively empty set. hashfiles also matches relative to the workspace, not the step's working-directory: results/ — it works only by accident.
  2. Lines 27,36continue-on-error: true on the upload and summary steps: SARIF upload failures (auth, quota, malformed) pass silently and code-scanning results just stop appearing with a green build. Line 40 then prints a possibly-empty sarif-id.
  3. Lines 3-4 — description is "Builds and deploys the source" (copy-paste); line 21 has unquoted >> $GITHUB_ENV.

Plan

  • Split delete and hash into separate steps, or compute presence in bash (find . -name '*.sarif' ! -name '*.Tests.sarif' | head -1).
  • Remove blanket continue-on-error; if forks/private repos legitimately cannot upload, gate on an explicit condition instead.
  • Fix description; quote the redirect; pass sarif-id via env: (covered by the injection round-2 issue too).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AI-WorkWork for an AI AgentBlockedBlocked!MediumMedium Prioritygithub-actionsGithub actions workflow files

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions