Skip to content

Commit 9346817

Browse files
committed
Pass through client
1 parent 3e3f2a8 commit 9346817

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/ModularPipelines.Build/Modules/WaitForOtherOperatingSystemBuilds.cs

+4-10
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ namespace ModularPipelines.Build.Modules;
2222
[DependsOn<PackProjectsModule>]
2323
public class WaitForOtherOperatingSystemBuilds : Module<List<WorkflowRun>>
2424
{
25-
private readonly IGitHubClient _gitHubClient;
26-
27-
public WaitForOtherOperatingSystemBuilds(IGitHubClient gitHubClient)
28-
{
29-
_gitHubClient = gitHubClient;
30-
}
31-
3225
/// <inheritdoc/>
3326
protected override Task<SkipDecision> ShouldSkip(IPipelineContext context)
3427
{
@@ -55,8 +48,8 @@ protected override Task<SkipDecision> ShouldSkip(IPipelineContext context)
5548
var windowsRun = windowsRuns.WorkflowRuns.FirstOrDefault(x => x.HeadSha == commitSha);
5649
var macRun = macRuns.WorkflowRuns.FirstOrDefault(x => x.HeadSha == commitSha);
5750

58-
var waitForWindows = await WaitFor(windowsRun, cancellationToken);
59-
var waitForMac = await WaitFor(macRun, cancellationToken);
51+
var waitForWindows = await WaitFor(context.GitHub().Client, windowsRun, cancellationToken);
52+
var waitForMac = await WaitFor(context.GitHub().Client, macRun, cancellationToken);
6053

6154
var list = new List<WorkflowRun>();
6255

@@ -73,7 +66,8 @@ protected override Task<SkipDecision> ShouldSkip(IPipelineContext context)
7366
return list;
7467
}
7568

76-
private async Task<WorkflowRun?> WaitFor(WorkflowRun? workflowRun, CancellationToken cancellationToken, [CallerArgumentExpression("workflowRun")] string expression = "")
69+
private async Task<WorkflowRun?> WaitFor(IGitHubClient client, WorkflowRun? workflowRun,
70+
CancellationToken cancellationToken, [CallerArgumentExpression("workflowRun")] string expression = "")
7771
{
7872
if (workflowRun == null)
7973
{

0 commit comments

Comments
 (0)