Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHES Raw URL Format Incorrect #1225

Open
grochoge opened this issue Mar 25, 2024 · 2 comments
Open

GHES Raw URL Format Incorrect #1225

grochoge opened this issue Mar 25, 2024 · 2 comments

Comments

@grochoge
Copy link

grochoge commented Mar 25, 2024

Using Github Enterprise Server 3.9.6 with Microsoft.SourceLink.GitHub 8.0.0.

SourceLink is using the /raw path on the main GitHub URL when it should be using the raw. subdomain.

Example of the URL generated:
https://github.INTERNAL_URL/raw/ORG_URL/REPO_URL/1e045336c6c208f216b8e2b2cbb3036a6f4ab41f/CPlusPlusProject/CPlusPlusProject.cpp

Should be:
https://raw.github.INTERNAL_URL/ORG_URL/REPO_URL/1e045336c6c208f216b8e2b2cbb3036a6f4ab41f/CPlusPlusProject/CPlusPlusProject.cpp

GitHub Enterprise Servers can be configured either way, but GitHub recommends using sub-domains for isolation. I'm not sure if there's a way to detect which is actually in use. I would imagine a DNS lookup to see if the raw. domain exists would be sufficient.

@tmat
Copy link
Member

tmat commented Mar 25, 2024

You might be able to configure this in your project (or Directory.Build.props file in the root to apply to all projects) like so:

 <ItemGroup>
    <SourceLinkGitHubHost Include="github.INTERNAL_URL" ContentUrl="https://raw.github.INTERNAL_URL"/>
  </ItemGroup>

@cliffchapmanrbx
Copy link

We have several thousand repositories on our GitHub Enterprise Server instance, configuring it across all of them will be a bit difficult to coordinate. I'm uncertain if there is any way to know the raw url config without making network requests, which would generally break determinism.

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

No branches or pull requests

3 participants