From 1ffb2e488c8d2fd59e301aedc2c08d337a08ecb5 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 23 Oct 2025 11:20:08 +0200 Subject: [PATCH] Fix content-source match when it has no matches --- src/tooling/docs-assembler/Cli/ContentSourceCommands.cs | 9 +++++++-- .../Commands/Assembler/ContentSourceCommands.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) 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); }