Skip to content

fix(sentinel): upload the SARIF it just wrote - #1497

Merged
Ndevu12 merged 1 commit into
mainfrom
fix/sentinel-sarif-upload
Aug 22, 2026
Merged

fix(sentinel): upload the SARIF it just wrote#1497
Ndevu12 merged 1 commit into
mainfrom
fix/sentinel-sarif-upload

Conversation

@Ndevu12

@Ndevu12 Ndevu12 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

The sentinel's two SARIF upload steps have never run.

Both were guarded by:

if: ${{ always() && hashFiles(format('{0}/latest.sarif', runner.temp)) != '' }}

hashFiles() resolves paths against GITHUB_WORKSPACE and cannot see runner.temp, so it returned
empty on every run and both uploads skipped — whether or not the file had been written.

The last run shows it plainly: the scan wrote the file, and the artifact step was skipped anyway.

SARIF written to /home/runner/work/_temp/latest.sarif
Security alerts processed: 1 infected, 0 suspicious, 0 clean.
##[error]Process completed with exit code 1.

  4. failure  Scan, alert, and emit SARIF
  5. skipped  Upload SARIF to code-scanning
  7. skipped  Upload SARIF as build artifact

That fails exactly when it matters most: step 6 tells the reader findings are "delivered via the run
log, the SARIF build artifact below, and --alert" — and one of those three has never existed.

Fix

The scan step reports whether it wrote the file, and the uploads key off that instead of a check that
cannot see the path:

if: ${{ always() && steps.scan.outputs.sarif == 'true' }}

The verdict is unchanged

The exit code is captured, the flag recorded, then the step exits with it — so an infected main
still fails the run exactly as before. The always() guards stay, which is what lets the upload
happen despite that non-zero exit.

Both upload steps were guarded by hashFiles() on a RUNNER_TEMP path. hashFiles resolves
against the workspace and cannot see that directory, so the guard was false on every run and
the SARIF was never uploaded - including the runs that found something. The scan step now
reports whether it wrote the file, and the uploads key off that.

The verdict is unchanged: the exit code is captured, the flag recorded, and the step still
exits with it, so an infected main still fails the run.
@Ndevu12 Ndevu12 self-assigned this Aug 22, 2026
@Ndevu12 Ndevu12 added enhancement New feature or request remediation Remediation behaviour and the guidance saw emits labels Aug 22, 2026
@Ndevu12
Ndevu12 merged commit ec61933 into main Aug 22, 2026
10 checks passed
@Ndevu12
Ndevu12 deleted the fix/sentinel-sarif-upload branch August 22, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request remediation Remediation behaviour and the guidance saw emits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant