-
Notifications
You must be signed in to change notification settings - Fork 183
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
Failed the validation when use relative links #895
Changes from 8 commits
09d1589
6d75043
1b200a7
04887d7
fcc0f0c
6acc9af
02d51a6
901acdf
b48ad15
e93148b
519b473
1e5a167
122f192
824a3e1
3f2d8cd
b3a1f7e
0fe62c0
27e9f6f
ea224d4
53fd6e3
7f8cf43
d943b89
9ba0e2e
1cba484
b96fd2a
f4d1f6b
21e23aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
parameters: | ||
Directory: 'not-specified' | ||
IgnoreLinksFile: "$(Build.SourcesDirectory)/eng/ignore-links.txt" | ||
|
||
WorkingDirectory: $(System.DefaultWorkingDirectory) | ||
ScriptDirectory: eng/common/scripts | ||
steps: | ||
- task: PowerShell@2 | ||
displayName: Link verification check | ||
inputs: | ||
pwsh: true | ||
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.Directory }} | ||
filePath: eng/common/scripts/Verify-Links.ps1 | ||
arguments: > | ||
-urls $(dir -r -i *.md) | ||
-rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" | ||
-recursive: $false | ||
-ignoreLinksFile ${{ parameters.IgnoreLinksFile }} | ||
-branchReplaceRegex "^($env:SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI.*/(?:blob|tree)/)master(/.*)$" | ||
-branchReplacementName $env:SYSTEM_PULLREQUEST_SOURCECOMMITID | ||
-devOpsLogging: $true | ||
- task: PowerShell@2 | ||
displayName: Link verification check | ||
inputs: | ||
pwsh: true | ||
workingDirectory: "${{ parameters.WorkingDirectory }}/${{ parameters.Directory }}" | ||
filePath: ${{ parameters.ScriptDirectory }}/Verify-Links.ps1 | ||
arguments: > | ||
-urls $(dir -r -i *.md) | ||
sima-zhu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" | ||
-recursive: $false | ||
-ignoreLinksFile ${{ parameters.IgnoreLinksFile }} | ||
-branchReplaceRegex "^($env:SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI.*/(?:blob|tree)/)master(/.*)$" | ||
-branchReplacementName $env:SYSTEM_PULLREQUEST_SOURCECOMMITID | ||
-devOpsLogging: $true | ||
-checkLinkGuidance: $true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to make all these parameters options to the yml template so we can control them as needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let do this for all the parameters: urls, recursive, branchreplaceregex, branchreplacementname, checklinkguidance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should contain directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is running against all the markdown under working directory, so we need to take in the $serviceDirectory for workingDirectory, otherwise we will run the entire repo e.g. /azure-sdk-for-java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK yes the dir is against the current working directory. However now we have a chance that the rooturl and the working directory are not in sync. We need to make those consistent.