Skip to content

Commit 3360a57

Browse files
committed
patch github reporter
1 parent aa1f1d7 commit 3360a57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/github_reporter/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19304,6 +19304,7 @@ var require_stack_utils = __commonJS({
1930419304
});
1930519305

1930619306
// node_modules/@reporters/github/index.js
19307+
var { fileURLToPath } = require("node:url");
1930719308
var path = require("node:path");
1930819309
var util = require("node:util");
1930919310
var { EOL } = require("node:os");
@@ -19312,10 +19313,13 @@ var StackUtils = require_stack_utils();
1931219313
var WORKSPACE = process.env.GITHUB_WORKSPACE ?? "";
1931319314
var stack = new StackUtils({ cwd: WORKSPACE, internals: StackUtils.nodeInternals() });
1931419315
var isFile = (name) => name?.startsWith(WORKSPACE);
19315-
var getRelativeFilePath = (name) => isFile(name) ? path.relative(WORKSPACE, require.resolve(name) ?? "") : null;
19316+
var getRelativeFilePath = (name) => isFile(name) ? path.relative(WORKSPACE, name) : null;
1931619317
function getFilePath(fileName) {
1931719318
if (fileName.startsWith("file://")) {
19318-
return getRelativeFilePath(new URL(fileName).pathname);
19319+
return getRelativeFilePath(fileURLToPath(fileName));
19320+
}
19321+
if (!path.isAbsolute(fileName)) {
19322+
return getRelativeFilePath(path.resolve(fileName) ?? "");
1931919323
}
1932019324
return getRelativeFilePath(fileName);
1932119325
}

0 commit comments

Comments
 (0)