@@ -253,7 +253,7 @@ func (b *Backend) createOccurrence(ctx context.Context, obj objects.TektonObject
253253 }
254254
255255 // create Occurrence_Build for TaskRun
256- allURIs := extract . RetrieveAllArtifactURIs (ctx , obj , b . cfg . Artifacts . PipelineRuns . DeepInspectionEnabled )
256+ allURIs := b . getAllArtifactURIs (ctx , opts . PayloadFormat , obj )
257257 for _ , uri := range allURIs {
258258 occ , err := b .createBuildOccurrence (ctx , obj , payload , signature , uri )
259259 if err != nil {
@@ -264,6 +264,19 @@ func (b *Backend) createOccurrence(ctx context.Context, obj objects.TektonObject
264264 return occs , nil
265265}
266266
267+ func (b * Backend ) getAllArtifactURIs (ctx context.Context , payloadFormat config.PayloadType , obj objects.TektonObject ) []string {
268+ payloader , err := formats .GetPayloader (payloadFormat , b .cfg )
269+ if err != nil {
270+ return extract .RetrieveAllArtifactURIs (ctx , obj , b .cfg .Artifacts .PipelineRuns .DeepInspectionEnabled )
271+ }
272+
273+ if uris , err := payloader .RetrieveAllArtifactURIs (ctx , obj ); err == nil {
274+ return uris
275+ }
276+
277+ return extract .RetrieveAllArtifactURIs (ctx , obj , b .cfg .Artifacts .PipelineRuns .DeepInspectionEnabled )
278+ }
279+
267280func (b * Backend ) createAttestationOccurrence (ctx context.Context , payload []byte , signature string , uri string ) (* pb.Occurrence , error ) {
268281 occurrenceDetails := & pb.Occurrence_Attestation {
269282 Attestation : & pb.AttestationOccurrence {
0 commit comments