@@ -313,9 +313,9 @@ def main_code():
313313 sbom_files_to_submit = []
314314 for scan_path in scan_paths :
315315 sbom_files_to_submit .extend (core .find_sbom_files (scan_path ))
316- facts_path = os . path . abspath ( output_path )
317- if os .path .exists (facts_path ):
318- sbom_files_to_submit .append (facts_path )
316+ # Use relative path for facts file
317+ if os .path .exists (output_path ):
318+ sbom_files_to_submit .append (output_path )
319319 log .info (f"Pre-generated SBOMs mode: will submit { len (sbom_files_to_submit )} files (CDX, SPDX, and facts file)" )
320320
321321 except Exception as e :
@@ -474,7 +474,7 @@ def main_code():
474474 log .info ("Push initiated flow" )
475475 if scm .check_event_type () == "diff" :
476476 log .info ("Starting comment logic for PR/MR event" )
477- diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths )
477+ diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths , explicit_files = sbom_files_to_submit )
478478 comments = scm .get_comments_for_pr ()
479479 log .debug ("Removing comment alerts" )
480480
@@ -527,14 +527,14 @@ def main_code():
527527 )
528528 else :
529529 log .info ("Starting non-PR/MR flow" )
530- diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths )
530+ diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths , explicit_files = sbom_files_to_submit )
531531
532532 output_handler .handle_output (diff )
533-
533+
534534 elif config .enable_diff and not force_api_mode :
535535 # New logic: --enable-diff forces diff mode even with --integration api (no SCM)
536536 log .info ("Diff mode enabled without SCM integration" )
537- diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths )
537+ diff = core .create_new_diff (scan_paths , params , no_change = should_skip_scan , save_files_list_path = config .save_submitted_files_list , save_manifest_tar_path = config .save_manifest_tar , base_paths = base_paths , explicit_files = sbom_files_to_submit )
538538 output_handler .handle_output (diff )
539539
540540 elif config .enable_diff and force_api_mode :
@@ -552,12 +552,13 @@ def main_code():
552552 no_change = should_skip_scan ,
553553 save_files_list_path = config .save_submitted_files_list ,
554554 save_manifest_tar_path = config .save_manifest_tar ,
555- base_paths = base_paths
555+ base_paths = base_paths ,
556+ explicit_files = sbom_files_to_submit
556557 )
557558 log .info (f"Full scan created with ID: { diff .id } " )
558559 log .info (f"Full scan report URL: { diff .report_url } " )
559560 output_handler .handle_output (diff )
560-
561+
561562 else :
562563 if force_api_mode :
563564 log .info ("No Manifest files changed, creating Socket Report" )
@@ -572,7 +573,8 @@ def main_code():
572573 no_change = should_skip_scan ,
573574 save_files_list_path = config .save_submitted_files_list ,
574575 save_manifest_tar_path = config .save_manifest_tar ,
575- base_paths = base_paths
576+ base_paths = base_paths ,
577+ explicit_files = sbom_files_to_submit
576578 )
577579 log .info (f"Full scan created with ID: { diff .id } " )
578580 log .info (f"Full scan report URL: { diff .report_url } " )
@@ -583,7 +585,8 @@ def main_code():
583585 no_change = should_skip_scan ,
584586 save_files_list_path = config .save_submitted_files_list ,
585587 save_manifest_tar_path = config .save_manifest_tar ,
586- base_paths = base_paths
588+ base_paths = base_paths ,
589+ explicit_files = sbom_files_to_submit
587590 )
588591 output_handler .handle_output (diff )
589592
0 commit comments