mirror of
https://github.com/github/codeql-action.git
synced 2026-11-06 21:19:42 +00:00
decode SARIF URIs when filtering diff-informed alerts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b1744ae3-8204-4901-8dc7-16368fd6d865
This commit is contained in:
12
lib/entry-points.js
generated
12
lib/entry-points.js
generated
@@ -188340,11 +188340,19 @@ function filterAlertsByDiffRange(logger2, sarifLog) {
|
||||
return locations.some((physicalLocation) => {
|
||||
const locationUri = physicalLocation?.artifactLocation?.uri;
|
||||
const locationStartLine = physicalLocation?.region?.startLine;
|
||||
if (!locationUri || locationStartLine === void 0) {
|
||||
if (typeof locationUri !== "string" || !locationUri || locationStartLine === void 0) {
|
||||
return false;
|
||||
}
|
||||
let locationPath = locationUri;
|
||||
try {
|
||||
locationPath = decodeURIComponent(locationUri);
|
||||
} catch {
|
||||
logger2.debug(
|
||||
`Failed to decode location URI "${locationUri}", comparing it as a raw path`
|
||||
);
|
||||
}
|
||||
return diffRanges.some(
|
||||
(range2) => range2.path === locationUri && (range2.startLine <= locationStartLine && range2.endLine >= locationStartLine || range2.startLine === 0 && range2.endLine === 0)
|
||||
(range2) => range2.path === locationPath && (range2.startLine <= locationStartLine && range2.endLine >= locationStartLine || range2.startLine === 0 && range2.endLine === 0)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user