Support default branch for the workflow. Part 1 (#1979)
Co-authored-by: Sima Zhu <sizhu@microsoft.com>
This commit is contained in:
parent
f1688491d9
commit
8d435df2d3
@ -8,6 +8,7 @@ parameters:
|
||||
RepoId: $(Build.Repository.Name)
|
||||
|
||||
steps:
|
||||
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
|
||||
- pwsh: |
|
||||
Invoke-WebRequest -MaximumRetryCount 10 -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile "azcopy.zip" | Wait-Process;
|
||||
Expand-Archive -Path "azcopy.zip" -DestinationPath "$(Build.BinariesDirectory)/azcopy/"
|
||||
@ -23,7 +24,7 @@ steps:
|
||||
-SASKey "${{ parameters.BlobSASKey }}"
|
||||
-BlobName "${{ parameters.BlobName }}"
|
||||
-PublicArtifactLocation "${{ parameters.ArtifactLocation }}"
|
||||
-RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)master"
|
||||
-RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)$(DefaultBranch)"
|
||||
pwsh: true
|
||||
workingDirectory: $(Pipeline.Workspace)
|
||||
displayName: Copy Docs to Blob
|
||||
|
||||
@ -63,7 +63,7 @@ Uses cspell (from NPM) to check spelling of recently changed files
|
||||
|
||||
.DESCRIPTION
|
||||
This script checks files that have changed relative to a base branch (default
|
||||
`master`) for spelling errors. Dictionaries and spelling configurations reside
|
||||
branch) for spelling errors. Dictionaries and spelling configurations reside
|
||||
in a configurable `cspell.json` location.
|
||||
|
||||
This script uses `npx` and assumes that NodeJS (and by extension `npm` and `npx`
|
||||
|
||||
@ -8,7 +8,7 @@ param (
|
||||
$ExitOnError=1,
|
||||
$UploadLatest=1,
|
||||
$PublicArtifactLocation = "",
|
||||
$RepoReplaceRegex = "(https://github.com/.*/(?:blob|tree)/)master"
|
||||
$RepoReplaceRegex = ""
|
||||
)
|
||||
|
||||
. (Join-Path $PSScriptRoot common.ps1)
|
||||
@ -199,7 +199,7 @@ function Upload-Blobs
|
||||
LogDebug "Final Dest $($DocDest)/$($PkgName)/$($DocVersion)"
|
||||
LogDebug "Release Tag $($ReleaseTag)"
|
||||
|
||||
# Use the step to replace master link to release tag link
|
||||
# Use the step to replace default branch link to release tag link
|
||||
if ($ReleaseTag) {
|
||||
foreach ($htmlFile in (Get-ChildItem $DocDir -include *.html -r))
|
||||
{
|
||||
@ -211,7 +211,7 @@ function Upload-Blobs
|
||||
}
|
||||
}
|
||||
else {
|
||||
LogWarning "Not able to do the master link replacement, since no release tag found for the release. Please manually check."
|
||||
LogWarning "Not able to do the default branch link replacement, since no release tag found for the release. Please manually check."
|
||||
}
|
||||
|
||||
LogDebug "Uploading $($PkgName)/$($DocVersion) to $($DocDest)..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user