Skip to content

Commit 7f8c3a5

Browse files
authored
fix(policies): skip GetEvaluableContent when no policies apply (#2964)
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 1041f32 commit 7f8c3a5

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)