Repository navigation
fix: decode SARIF location URIs in diff-informed alert filtering - #4283
Merged
Merged
Conversation
sam-robson
force-pushed
the
sam-robson/decode-diff-informed-sarif-uris
branch
2 times, most recently
from
November 2, 2026 16:00
8b728b0 to
c15b59e
Compare
sam-robson
force-pushed
the
sam-robson/decode-diff-informed-sarif-uris
branch
from
November 2, 2026 16:04
c15b59e to
b05fe69
Compare
sam-robson
marked this pull request as ready for review
filterAlertsByDiffRangecompares SARIFartifactLocation.urivalues against changed file paths from GitHub's diff API (range.path). CodeQL percent-encodesartifactLocation.uriin SARIF, whilerange.pathis a raw file path, so alerts in files with spaces, non-ASCII characters, or special characters were dropped during diff-informed filtering.Decode
locationUriwithdecodeURIComponentbefore matching againstrange.path, while keeping the rawlocationUricheck for unencoded paths or malformed percent sequences.filterAlertsByDiffRange(sarifLog) readDiffRangesJsonFile() -> range.path ("with space/board.js") for each result location locationUri = physicalLocation.artifactLocation.uri ("with%20space/board.js") + decodedLocationUri = decodeURIComponent(locationUri) ("with space/board.js") - match range.path === locationUri + match range.path === decodedLocationUri || range.path === locationUriRisk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.upload-sarifaction.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist