Update references from master to main (#2492)
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
parent
9dde20e021
commit
187fc867f4
@ -27,7 +27,7 @@
|
||||
List of http status codes that count as broken links. Defaults to 400, 401, 404, SocketError.HostNotFound = 11001, SocketError.NoData = 11004.
|
||||
|
||||
.PARAMETER branchReplaceRegex
|
||||
Regex to check if the link needs to be replaced. E.g. ^(https://github.com/.*/(?:blob|tree)/)master(/.*)$
|
||||
Regex to check if the link needs to be replaced. E.g. ^(https://github.com/.*/(?:blob|tree)/)main(/.*)$
|
||||
|
||||
.PARAMETER branchReplacementName
|
||||
The substitute branch name or SHA commit.
|
||||
|
||||
@ -67,10 +67,10 @@ function GetAdjustedReadmeContent($pkgInfo){
|
||||
$fileContent = $fileContent -replace $titleRegex, "`${0} - Version $($pkgInfo.PackageVersion) `n"
|
||||
$foundTitle = $matches["filetitle"]
|
||||
}
|
||||
# Replace github master link with release tag.
|
||||
# Replace github main link with release tag.
|
||||
$ReplacementPattern = "`${1}$($pkgInfo.Tag)"
|
||||
$fileContent = $fileContent -replace $releaseReplaceRegex, $ReplacementPattern
|
||||
|
||||
|
||||
$header = "---`ntitle: $foundTitle`nkeywords: Azure, $Language, SDK, API, $($pkgInfo.PackageId), $service`nauthor: maggiepint`nms.author: magpint`nms.date: $date`nms.topic: article`nms.prod: azure`nms.technology: azure`nms.devlang: $Language`nms.service: $service`n---`n"
|
||||
|
||||
if ($fileContent) {
|
||||
@ -101,7 +101,7 @@ foreach ($config in $targets) {
|
||||
if ($pkgsFiltered) {
|
||||
Write-Host "Given the visible artifacts, $($config.mode) Readme updates against $($config.path_to_config) will be processed for the following packages."
|
||||
Write-Host ($pkgsFiltered | % { $_.PackageId + " " + $_.PackageVersion })
|
||||
|
||||
|
||||
foreach ($packageInfo in $pkgsFiltered) {
|
||||
$readmeName = "$($packageInfo.DocsReadMeName.ToLower())-readme${suffix}.md"
|
||||
$readmeFolder = Join-Path $DocRepoLocation $config.content_folder
|
||||
@ -115,12 +115,12 @@ foreach ($config in $targets) {
|
||||
if ($packageInfo.ReadmeContent) {
|
||||
$adjustedContent = GetAdjustedReadmeContent -pkgInfo $packageInfo
|
||||
}
|
||||
|
||||
|
||||
if ($adjustedContent) {
|
||||
try {
|
||||
Push-Location $DocRepoLocation
|
||||
Set-Content -Path $readmeLocation -Value $adjustedContent -Force
|
||||
|
||||
|
||||
Write-Host "Updated readme for $readmeName."
|
||||
} catch {
|
||||
Write-Host $_
|
||||
|
||||
Loading…
Reference in New Issue
Block a user