Skip to content

Commit 50c6e5a

Browse files
committed
enhance: add PipelineRun name in pr json marshalling
Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
1 parent 860c901 commit 50c6e5a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/pipelineascode/match.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ func (p *PacRun) changePipelineRun(ctx context.Context, repo *v1alpha1.Repositor
398398
for k, pr := range prs {
399399
b, err := json.Marshal(pr)
400400
if err != nil {
401-
return err
401+
prName := pr.GetName()
402+
if prName == "" {
403+
prName = pr.GetGenerateName()
404+
}
405+
return fmt.Errorf("failed to marshal PipelineRun %s: %w", prName, err)
402406
}
403407

404408
name := secrets.GenerateBasicAuthSecretName()

0 commit comments

Comments
 (0)