@@ -183,10 +183,14 @@ func GetRepositoryWorkflowRuns(ctx context.Context, sdk *resilientbridge.Resilie
183183 }
184184 runDetail .ArtifactCount = artifactCount
185185 runDetail .Artifacts = artifacts
186+ var name string
187+ if runDetail .Name != nil {
188+ name = * runDetail .Name
189+ }
186190
187191 value := models.Resource {
188192 ID : strconv .Itoa (runDetail .ID ),
189- Name : runDetail . Name ,
193+ Name : name ,
190194 Description : JSONAllFieldsMarshaller {
191195 Value : runDetail ,
192196 },
@@ -441,19 +445,19 @@ func fetchRunDetails(sdk *resilientbridge.ResilientBridge, owner, repo string, r
441445
442446 return model.WorkflowRunDescription {
443447 ID : fullDetail .ID ,
444- Name : fullDetail .Name ,
445- HeadBranch : fullDetail .HeadBranch ,
446- HeadSHA : fullDetail .HeadSHA ,
447- Status : fullDetail .Status ,
448- Conclusion : fullDetail .Conclusion ,
449- HTMLURL : fullDetail .HTMLURL ,
448+ Name : & fullDetail .Name ,
449+ HeadBranch : & fullDetail .HeadBranch ,
450+ HeadSHA : & fullDetail .HeadSHA ,
451+ Status : & fullDetail .Status ,
452+ Conclusion : & fullDetail .Conclusion ,
453+ HTMLURL : & fullDetail .HTMLURL ,
450454 WorkflowID : fullDetail .WorkflowID ,
451455 RunNumber : fullDetail .RunNumber ,
452- Event : fullDetail .Event ,
453- CreatedAt : fullDetail .CreatedAt ,
454- UpdatedAt : fullDetail .UpdatedAt ,
456+ Event : & fullDetail .Event ,
457+ CreatedAt : & fullDetail .CreatedAt ,
458+ UpdatedAt : & fullDetail .UpdatedAt ,
455459 RunAttempt : fullDetail .RunAttempt ,
456- RunStartedAt : fullDetail .RunStartedAt ,
460+ RunStartedAt : & fullDetail .RunStartedAt ,
457461 Actor : fullDetail .Actor ,
458462 HeadCommit : fullDetail .HeadCommit ,
459463 Repository : fullDetail .Repository ,
@@ -484,5 +488,22 @@ func fetchArtifactsForRun(sdk *resilientbridge.ResilientBridge, owner, repo stri
484488 return 0 , nil , fmt .Errorf ("error decoding artifacts response: %w" , err )
485489 }
486490
487- return artResp .TotalCount , artResp .Artifacts , nil
491+ var artifacts []model.WorkflowArtifact
492+
493+ for _ , artifact := range artResp .Artifacts {
494+ artifacts = append (artifacts , model.WorkflowArtifact {
495+ ID : artifact .ID ,
496+ NodeID : & artifact .NodeID ,
497+ Name : & artifact .Name ,
498+ SizeInBytes : artifact .SizeInBytes ,
499+ URL : & artifact .URL ,
500+ ArchiveDownloadURL : & artifact .ArchiveDownloadURL ,
501+ Expired : artifact .Expired ,
502+ CreatedAt : & artifact .CreatedAt ,
503+ UpdatedAt : & artifact .UpdatedAt ,
504+ ExpiresAt : & artifact .ExpiresAt ,
505+ })
506+ }
507+
508+ return artResp .TotalCount , artifacts , nil
488509}
0 commit comments