@@ -507,10 +507,10 @@ func pullBuildOutputs(ctx context.Context, client stainless.Client, res stainles
507507 // Get all targets
508508 allTargets := getBuildTargetInfo (res )
509509
510- // Filter to only completed targets
510+ // Filter to only completed targets without fatal conclusions
511511 var targets []string
512512 for _ , target := range allTargets {
513- if isTargetCompleted (target .status ) {
513+ if isTargetCompleted (target .status ) && ! hasFailedCommitStep ( res , stainless . Target ( target . name )) {
514514 targets = append (targets , target .name )
515515 }
516516 }
@@ -571,6 +571,26 @@ func pullBuildOutputs(ctx context.Context, client stainless.Client, res stainles
571571 return nil
572572}
573573
574+ // hasFailedCommitStep checks if a target has a fatal commit conclusion
575+ func hasFailedCommitStep (build stainless.BuildObject , target stainless.Target ) bool {
576+ buildTarget := getBuildTarget (& build , target )
577+ if buildTarget == nil {
578+ return false
579+ }
580+
581+ commitUnion := getStepUnion (buildTarget , "commit" )
582+ if commitUnion == nil {
583+ return false
584+ }
585+
586+ status , _ , conclusion := extractStepInfo (commitUnion )
587+ if status == "completed" && conclusion == "fatal" {
588+ return true
589+ }
590+
591+ return false
592+ }
593+
574594// stripHTTPAuth removes HTTP authentication credentials from a URL for display purposes
575595func stripHTTPAuth (urlStr string ) string {
576596 parsedURL , err := url .Parse (urlStr )
0 commit comments