Use url.pathToFileURL instead of file-url

This commit is contained in:
Henry Mercer
2025-08-29 19:17:34 +01:00
parent c2b56013b4
commit 943116bc89
14 changed files with 1575 additions and 1699 deletions

View File

@@ -1,10 +1,10 @@
import * as fs from "fs";
import * as path from "path";
import * as url from "url";
import zlib from "zlib";
import * as core from "@actions/core";
import { OctokitResponse } from "@octokit/types";
import fileUrl from "file-url";
import * as jsonschema from "jsonschema";
import * as actionsUtil from "./actions-util";
@@ -728,7 +728,7 @@ export async function uploadSpecifiedFiles(
const sarifPayload = JSON.stringify(sarif);
logger.debug(`Compressing serialized SARIF`);
const zippedSarif = zlib.gzipSync(sarifPayload).toString("base64");
const checkoutURI = fileUrl(checkoutPath);
const checkoutURI = url.pathToFileURL(checkoutPath).href;
const payload = buildPayload(
await gitUtils.getCommitOid(checkoutPath),