moving file removal after the cache upload
@@ -90,12 +90,9 @@ class Runner(PackageRunner):
# read the report file
scan_result: Dict[str, Any] = json.loads(output_path.read_text())
- # upload results to cache
+ # upload results to cache and remove file
self.upload_results_to_cache(output_path, image_id)
- # delete the report file
- output_path.unlink()
-
return scan_result
def upload_results_to_cache(self, output_path: Path, image_id: str) -> None:
@@ -116,6 +113,8 @@ class Runner(PackageRunner):
else:
logging.info(f"Failed to upload scan results to cache with id={image_id}")
+ output_path.unlink()
+
def run(
self,
root_folder: Union[str, Path],
