Skip to content

Commit

Permalink
Fix sourcelink repository url (#7844)
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 1e11251 commit 52cba79
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

1 comment on commit 52cba79

@ericstj
Copy link
Member

@ericstj ericstj commented on 52cba79 Sep 8, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.