ci: make annotations always link to file content by commit (#15573)

This commit is contained in:
Meghan Denny
2024-12-04 01:30:26 -08:00
committed by GitHub
parent baff3c900e
commit 52ef8b1778

View File

@@ -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") {