Skip to content

Commit 4ca8373

Browse files
committed
fix(policies): skip GetEvaluableContent when no policies apply to material
Closes #2963 Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 81d3701 commit 4ca8373

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/policies/policy_groups.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ func (pgv *PolicyGroupVerifier) VerifyMaterial(ctx context.Context, material *ap
7777
return nil, NewPolicyError(err)
7878
}
7979

80+
// Skip loading content if no policies apply to this material
81+
if len(policyAtts) == 0 {
82+
continue
83+
}
84+
8085
// Load material content once for all policies in this group
8186
subject, err := material.GetEvaluableContent(path)
8287
if err != nil {

0 commit comments

Comments
 (0)