Skip to content

Commit

Permalink
Use same logic as add-build-to-channel when checking default channels (
Browse files Browse the repository at this point in the history
  • Loading branch information
dkurepa authored Aug 20, 2024
1 parent 1497629 commit 4396011
Showing 1 changed file with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,28 +196,12 @@ public async Task<bool> PushMetadataAsync(CancellationToken cancellationToken)
private async Task<IEnumerable<DefaultChannel>> GetBuildDefaultChannelsAsync(IMaestroApi client,
Client.Models.Build recordedBuild)
{
var defaultChannels = new List<DefaultChannel>();
if (recordedBuild.GitHubBranch != null && recordedBuild.GitHubRepository != null)
{
defaultChannels.AddRange(
await client.DefaultChannels.ListAsync(
branch: recordedBuild.GitHubBranch,
channelId: null,
enabled: true,
repository: recordedBuild.GitHubRepository
));
}

if (recordedBuild.AzureDevOpsBranch != null && recordedBuild.AzureDevOpsRepository != null)
{
defaultChannels.AddRange(
await client.DefaultChannels.ListAsync(
branch: recordedBuild.AzureDevOpsBranch,
channelId: null,
enabled: true,
repository: recordedBuild.AzureDevOpsRepository
));
}
IEnumerable<DefaultChannel> defaultChannels = await client.DefaultChannels.ListAsync(
branch: recordedBuild.GetBranch(),
channelId: null,
enabled: true,
repository: recordedBuild.GetRepository()
);

Log.LogMessage(MessageImportance.High, "Found the following default channels:");
foreach (var defaultChannel in defaultChannels)
Expand Down

0 comments on commit 4396011

Please sign in to comment.