Skip to content

Commit

Permalink
Fix sourcelink repository url (#7844) (#7847)
Browse files Browse the repository at this point in the history
* Fix sourcelink repository url

When we updated the ScmRepositoryUrl to handle devdiv links, we never updated the version used in SourceRoot, which is used by sourcelink, and also needed to be updated to remove -trusted from the link. By not removing -trusted, the translation pattern can't identify the url as something that needs to be translated, and so just uses the azdo url. This change adds the code to remove -trusted to fix the issue.

* Remove second item group
  • Loading branch information
michellemcdaniel committed Sep 7, 2021
1 parent eecf503 commit 8384be4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
</PropertyGroup>

<ItemGroup>
<SourceRoot Update="@(SourceRoot)">
<ScmRepositoryUrl Condition="$([System.String]::Copy(%(SourceRoot.ScmRepositoryUrl)).Contains(`devdiv.visualstudio`))">$([System.String]::Copy(%(SourceRoot.ScmRepositoryUrl)).ToLower().Replace(`-trusted`,``))</ScmRepositoryUrl>
</SourceRoot>
<SourceRoot Update="@(SourceRoot)">
<ScmRepositoryUrl>$([System.Text.RegularExpressions.Regex]::Replace(%(SourceRoot.ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement)))</ScmRepositoryUrl>
</SourceRoot>
Expand Down

0 comments on commit 8384be4

Please sign in to comment.