dotnet / dotnet/docfx

[Bug] DocFx generates incorrect links in "View Source" when building from a tag in Azure DevOps git repo

Open
#10,161 4 comments 1 reaction 0 assignees View on GitHub
static-site
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

Our builds are usually from a git tag in Azure DevOps, and in this case, the "View Source" button in DocFx is not working.

The link would work if we built from a branch, but not from a tag.

Example of generated link:
https://dev.azure.com/organizationName/projectname/_git/RepoName?path=Src/path/subpath/file.cs&version=GB7.104.0&line=8

7.104.0 is the name of our git tag.

Correct link would end with `GT7.104.0` not `GB7.104.0` as `GB` works only for branches, not tags.

**To Reproduce**
Steps to reproduce the behavior:
1. Run CLI dotnet `docfx` on a git tag version of Azure DevOps repo.

**Expected behavior**
The link should end with `GT{tag name}` instead of `GB{tag name}` for builds from a git tag.

**Context:**
- OS: Windows/Linux
- Docfx version: latest

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.