Move conversion of PR diff-range paths to absolute paths

This commit is contained in:
Kasper Svendsen
2025-10-28 13:23:31 +01:00
parent df4e1992c0
commit 4eb247591f
10 changed files with 56 additions and 75 deletions
+1 -3
View File
@@ -90616,7 +90616,6 @@ function filterAlertsByDiffRange(logger, sarif) {
if (!diffRanges?.length) {
return sarif;
}
const checkoutPath = getRequiredInput("checkout_path");
for (const run of sarif.runs) {
if (run.results) {
run.results = run.results.filter((result) => {
@@ -90630,9 +90629,8 @@ function filterAlertsByDiffRange(logger, sarif) {
if (!locationUri || locationStartLine === void 0) {
return false;
}
const locationPath = path10.join(checkoutPath, locationUri).replaceAll(path10.sep, "/");
return diffRanges.some(
(range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0)
(range) => range.path === locationUri && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0)
);
});
});