Skip to content

Commit 6ec11b6

Browse files
committed
Add inbound link validation to our smoke tests
1 parent ec432ba commit 6ec11b6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/smoke-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ jobs:
3939
4040
- name: Verify landing-page-path output
4141
run: test ${{ steps.docs-build.outputs.landing-page-path }} == ${{ matrix.landing-page-path-output }}
42+
43+
- name: Verify link validation
44+
id: docs-build
45+
run: |
46+
dotnet run --project src/tooling/docs-builder inbound-links validate-link-reference
47+

src/tooling/docs-builder/Cli/InboundLinkCommands.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,17 @@ public async Task<int> ValidateRepoInboundLinks(string? from = null, string? to
6969
/// Validate a locally published links.json file against all published links.json files in the registry
7070
/// </summary>
7171
/// <param name="file">Path to `links.json` defaults to '.artifacts/docs/html/links.json'</param>
72+
/// <param name="path"> -p, Defaults to the `{pwd}` folder</param>
7273
/// <param name="ctx"></param>
7374
[Command("validate-link-reference")]
7475
[ConsoleAppFilter<StopwatchFilter>]
7576
[ConsoleAppFilter<CatchExceptionFilter>]
76-
public async Task<int> ValidateLocalLinkReference([Argument] string? file = null, Cancel ctx = default)
77+
public async Task<int> ValidateLocalLinkReference(string? file = null, string? path = null, Cancel ctx = default)
7778
{
7879
AssignOutputLogger();
7980
file ??= ".artifacts/docs/html/links.json";
8081
var fs = new FileSystem();
81-
var root = fs.DirectoryInfo.New(Paths.WorkingDirectoryRoot.FullName);
82+
var root = !string.IsNullOrEmpty(path) ? fs.DirectoryInfo.New(path) : fs.DirectoryInfo.New(Paths.WorkingDirectoryRoot.FullName);
8283
var repository = GitCheckoutInformation.Create(root, new FileSystem(), logger.CreateLogger(nameof(GitCheckoutInformation))).RepositoryName
8384
?? throw new Exception("Unable to determine repository name");
8485

0 commit comments

Comments
 (0)