WIP: Move generation out absolute paths for diff-informed PR ranges

This commit is contained in:
Kasper Svendsen
2025-10-28 10:12:55 +01:00
parent 5e51e6e0db
commit d321539bd2
9 changed files with 43 additions and 63 deletions

View File

@@ -191,12 +191,7 @@ function getDiffRanges(
fileDiff: FileDiff,
logger: Logger,
): DiffThunkRange[] | undefined {
// Diff-informed queries expect the file path to be absolute. CodeQL always
// uses forward slashes as the path separator, so on Windows we need to
// replace any backslashes with forward slashes.
const filename = path
.join(actionsUtil.getRequiredInput("checkout_path"), fileDiff.filename)
.replaceAll(path.sep, "/");
const filename = fileDiff.filename;
if (fileDiff.patch === undefined) {
if (fileDiff.changes === 0) {