Test
This commit is contained in:
@@ -98,29 +98,29 @@ IGetWorkflowRunsApiResponse getWorkflowRunsApiResponse = await repositoryApi.Get
|
||||
if (!getWorkflowRunsApiResponse.TryOk(out ActionWorkflowRunsResponse workflowRunResponse))
|
||||
{
|
||||
Console.WriteLine("Failed to retrieve workflow runs.");
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
ActionWorkflowRun? actionWorkflowRun = workflowRunResponse.WorkflowRuns.FirstOrDefault(w => workflowRegex.IsMatch(w.Path.Split('@')[0]));
|
||||
if (actionWorkflowRun is null)
|
||||
{
|
||||
Console.WriteLine("No matching workflow run found.");
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
IGetArtifactsOfRunApiResponse artifacts = await repositoryApi.GetArtifactsOfRunOrDefaultAsync(repoOwner, repoName, (int)actionWorkflowRun.Id!, string.Empty, CancellationToken.None);
|
||||
if (!artifacts.TryOk(out ActionArtifactsResponse artifactsResponse))
|
||||
{
|
||||
Console.WriteLine("Failed to retrieve artifacts.");
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
if (artifactsResponse.Artifacts.Count == 0)
|
||||
ActionArtifact[] artifactsToDownload = artifactsResponse.Artifacts.Where(a => artifactRegex.IsMatch(a.Name)).ToArray();
|
||||
if (artifactsToDownload.Length is 0)
|
||||
{
|
||||
Console.WriteLine("No artifacts found for the specified workflow run.");
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
IEnumerable<ActionArtifact> artifactsToDownload = artifactsResponse.Artifacts.Where(a => artifactRegex.IsMatch(a.Name));
|
||||
|
||||
Console.WriteLine("Downloading artifacts:");
|
||||
foreach (ActionArtifact artifact in artifactsToDownload)
|
||||
@@ -157,3 +157,5 @@ foreach (ActionArtifact artifact in artifactsToDownload)
|
||||
File.Delete(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
Reference in New Issue
Block a user