diff --git a/src/tooling/docs-assembler/Cli/ContentSourceCommands.cs b/src/tooling/docs-assembler/Cli/ContentSourceCommands.cs index 373686a51..29fae97df 100644 --- a/src/tooling/docs-assembler/Cli/ContentSourceCommands.cs +++ b/src/tooling/docs-assembler/Cli/ContentSourceCommands.cs @@ -47,8 +47,13 @@ public async Task Match([Argument] string? repository = null, [Argument] st var fs = new FileSystem(); var service = new RepositoryBuildMatchingService(logFactory, configuration, configurationContext, githubActionsService, fs); serviceInvoker.AddCommand(service, (repository, branchOrTag), - static async (s, collector, state, _) => await s.ShouldBuild(collector, state.repository, state.branchOrTag) - ); + static async (s, collector, state, ctx) => + { + _ = await s.ShouldBuild(collector, state.repository, state.branchOrTag); + // ShouldBuild throws an exception on bad args and will return false if it has no matches + // We return true to the service invoker to continue + return true; + }); return await serviceInvoker.InvokeAsync(ctx); } diff --git a/src/tooling/docs-builder/Commands/Assembler/ContentSourceCommands.cs b/src/tooling/docs-builder/Commands/Assembler/ContentSourceCommands.cs index b4dd329ce..52bc35f45 100644 --- a/src/tooling/docs-builder/Commands/Assembler/ContentSourceCommands.cs +++ b/src/tooling/docs-builder/Commands/Assembler/ContentSourceCommands.cs @@ -46,8 +46,13 @@ public async Task Match([Argument] string? repository = null, [Argument] st var fs = new FileSystem(); var service = new RepositoryBuildMatchingService(logFactory, configuration, configurationContext, githubActionsService, fs); serviceInvoker.AddCommand(service, (repository, branchOrTag), - static async (s, collector, state, _) => await s.ShouldBuild(collector, state.repository, state.branchOrTag) - ); + static async (s, collector, state, ctx) => + { + _ = await s.ShouldBuild(collector, state.repository, state.branchOrTag); + // ShouldBuild throws an exception on bad args and will return false if it has no matches + // We return true to the service invoker to continue + return true; + }); return await serviceInvoker.InvokeAsync(ctx); }