Skip to content

Commit 8c49c69

Browse files
committed
fix: enable provenance expectation validation for user-provided provenances
Signed-off-by: Nathan Nguyen <[email protected]>
1 parent b3eb53a commit 8c49c69

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/macaron/slsa_analyzer/checks/provenance_l3_content_check.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData:
5858
logger.info("%s check was unable to find any expectations.", self.check_info.check_id)
5959
return CheckResultData(result_tables=[], result_type=CheckResultType.UNKNOWN)
6060

61+
if ctx.dynamic_data["provenance"]:
62+
if expectation.validate(ctx.dynamic_data["provenance"]):
63+
return CheckResultData(
64+
result_tables=[expectation],
65+
result_type=CheckResultType.PASSED,
66+
)
67+
return CheckResultData(
68+
result_tables=[expectation],
69+
result_type=CheckResultType.FAILED,
70+
)
71+
6172
package_registry_info_entries = ctx.dynamic_data["package_registries"]
6273
ci_services = ctx.dynamic_data["ci_services"]
6374

0 commit comments

Comments
 (0)