Skip to content

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

Merged
Suneha Bose (bosesuneha) merged 4 commits into
Azure:mainfrom
ejaifeobuks:fix/ghes-server-url
Nov 9, 2026
Merged

Suneha Bose (bosesuneha) merged 4 commits 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.
Comment thread src/utilities/githubUtils.ts Resolved
Extract the inline runUri template literal in getWorkflowAnnotations into
a named const for readability. Add a getNormalizedPath test covering the
custom GITHUB_SERVER_URL (GitHub Enterprise) branch.

@bosesuneha Suneha Bose (bosesuneha) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Could you please rebase this onto the latest main?

@ejaifeobuks

Copy link
Copy Markdown
Contributor Author

Suneha Bose (@bosesuneha) done

@bosesuneha
Suneha Bose (bosesuneha) merged commit 0bc931f into Azure:main Nov 9, 2026
13 checks passed
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

2 participants