From 3d464f0a27d7136cc879ba3a4599c098e7ecd781 Mon Sep 17 00:00:00 2001 From: Jono Yang Date: Tue, 7 Jan 2025 19:19:02 -0800 Subject: [PATCH] Update resources with match results Signed-off-by: Jono Yang --- scanpipe/pipes/matchcode.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scanpipe/pipes/matchcode.py b/scanpipe/pipes/matchcode.py index 1ad02899d..efa0db536 100644 --- a/scanpipe/pipes/matchcode.py +++ b/scanpipe/pipes/matchcode.py @@ -362,3 +362,9 @@ def create_packages_from_match_results(project, match_results): package_data=matched_package, status=flag.MATCHED_TO_PURLDB_PACKAGE, ) + match_resources = match_results.get("files", []) + for match_resource in match_resources: + match_resource_extra_data = match_resource["extra_data"] + if match_resource_extra_data: + resource = project.codebaseresources.get(path=match_resource["path"]) + resource.update_extra_data(match_resource_extra_data)