mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
ci: make annotations always link to file content by commit (#15573)
This commit is contained in:
@@ -1120,17 +1120,6 @@ export function getFileUrl(filename, line) {
|
||||
}
|
||||
|
||||
const filePath = (cwd ? relative(cwd, filename) : filename).replace(/\\/g, "/");
|
||||
const pullRequest = getPullRequest();
|
||||
|
||||
if (pullRequest) {
|
||||
const fileMd5 = createHash("sha256").update(filePath).digest("hex");
|
||||
const url = new URL(`pull/${pullRequest}/files#diff-${fileMd5}`, `${baseUrl}/`);
|
||||
if (typeof line !== "undefined") {
|
||||
return new URL(`R${line}`, url);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
const commit = getCommit(cwd);
|
||||
const url = new URL(`blob/${commit}/${filePath}`, `${baseUrl}/`).toString();
|
||||
if (typeof line !== "undefined") {
|
||||
|
||||
Reference in New Issue
Block a user