Skip to content

fix: support GitHub Enterprise Server domains in annotation URLs#542

Open
ejaifeobuks wants to merge 1 commit into
Azure:mainfrom
ejaifeobuks:fix/ghes-server-url
Open

fix: support GitHub Enterprise Server domains in annotation URLs#542
ejaifeobuks wants to merge 1 commit into
Azure:mainfrom
ejaifeobuks:fix/ghes-server-url

Conversation

@ejaifeobuks

Copy link
Copy Markdown
Contributor

Replace hardcoded https://github.com in the deployment annotation runUri and getNormalizedPath blob links with GITHUB_SERVER_URL, falling back to https://github.com when the var is unset. This makes the generated links correct on GitHub Enterprise Server instances hosted on custom domains.

This PR fixes issue
This pull request improves how URLs are constructed for GitHub resources by ensuring that the correct GitHub server URL is used, especially in environments where GitHub Enterprise or custom domains are in use. The changes make the code more flexible and robust for different deployment scenarios.

URL Construction Improvements:

  • Updated getNormalizedPath in src/utilities/githubUtils.ts to use GITHUB_SERVER_URL (defaulting to https://github.com) when constructing blob URLs, instead of hardcoding the domain.
  • Updated getWorkflowAnnotations in src/utilities/workflowAnnotationUtils.ts to use GITHUB_SERVER_URL (defaulting to https://github.com) when constructing workflow run URLs, instead of hardcoding the domain.
  • This PR fixes issue Fix annotations links using github.com even for GHES #201

Replace hardcoded https://github.com in the deployment annotation
runUri and getNormalizedPath blob links with GITHUB_SERVER_URL,
falling back to https://github.com when the var is unset. This makes
the generated links correct on GitHub Enterprise Server instances
hosted on custom domains.
@ejaifeobuks ejaifeobuks requested a review from a team as a code owner June 30, 2026 18:13
@ejaifeobuks ejaifeobuks linked an issue Jun 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix annotations links using github.com even for GHES

1 participant