Skip to content

Commit

Permalink
fix line linking for GH Enterprise (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 authored Mar 25, 2024
1 parent ee5787c commit 2f27e73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38961,7 +38961,8 @@ function formatFileUrl(sourceDir, fileName, commit) {
// Strip leading and trailing slashes.
sourceDir = sourceDir.replace(/\/$/, "").replace(/^\//, "");
const path = (sourceDir ? `${sourceDir}/` : "") + fileName;
return `https://github.com/${repo.owner}/${repo.repo}/blob/${commit}/${path}`;
const githubUrl = process.env["GITHUB_SERVER_URL"] || "https://github.com";
return `${githubUrl}/${repo.owner}/${repo.repo}/blob/${commit}/${path}`;
}

function formatRangeText([start, end]) {
Expand Down
3 changes: 2 additions & 1 deletion src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function formatFileUrl(sourceDir, fileName, commit) {
// Strip leading and trailing slashes.
sourceDir = sourceDir.replace(/\/$/, "").replace(/^\//, "");
const path = (sourceDir ? `${sourceDir}/` : "") + fileName;
return `https://github.com/${repo.owner}/${repo.repo}/blob/${commit}/${path}`;
const githubUrl = process.env["GITHUB_SERVER_URL"] || "https://github.com";
return `${githubUrl}/${repo.owner}/${repo.repo}/blob/${commit}/${path}`;
}

function formatRangeText([start, end]) {
Expand Down

0 comments on commit 2f27e73

Please sign in to comment.