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

Sync eng/common directory with azure-sdk-tools for PR 1739 #14911

Merged
merged 1 commit into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/common/scripts/Verify-Links.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions eng/common/scripts/update-docs-metadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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 $_
Expand Down