From 71ee93d774d8850f7e822b97a32872f8a9b33fea Mon Sep 17 00:00:00 2001 From: Martin Torp Date: Tue, 26 Aug 2025 11:07:51 +0200 Subject: [PATCH] upload all manifests files when running `socket scan create --reach` --- src/commands/scan/handle-create-new-scan.mts | 11 ++++++++--- src/commands/scan/perform-reachability-analysis.mts | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/commands/scan/handle-create-new-scan.mts b/src/commands/scan/handle-create-new-scan.mts index 0cb8bea65..dd22571c0 100644 --- a/src/commands/scan/handle-create-new-scan.mts +++ b/src/commands/scan/handle-create-new-scan.mts @@ -151,9 +151,14 @@ export async function handleCreateNewScan({ logger.success('Reachability analysis completed successfully') - scanPaths = reachResult.data?.reachabilityReport - ? [reachResult.data.reachabilityReport] - : [] + scanPaths = [ + ...packagePaths.filter( + // Ensure the .socket.facts.json isn't duplicated in case it happened + // to be in the scan folder before the analysis was run. + p => !p.endsWith(constants.DOT_SOCKET_DOT_FACTS_JSON), + ), + reachResult.data?.reachabilityReport, + ] tier1ReachabilityScanId = reachResult.data?.tier1ReachabilityScanId } diff --git a/src/commands/scan/perform-reachability-analysis.mts b/src/commands/scan/perform-reachability-analysis.mts index 370c6dc56..e41c8e949 100644 --- a/src/commands/scan/perform-reachability-analysis.mts +++ b/src/commands/scan/perform-reachability-analysis.mts @@ -60,7 +60,8 @@ export async function performReachabilityAnalysis( const wasSpinning = !!spinner?.isSpinning - // Exclude .socket.facts.json from upload. + // Exclude any .socket.facts.json files that happen to be + // in the scan folder before the analysis was run. const filepathsToUpload = packagePaths.filter( p => !p.endsWith(constants.DOT_SOCKET_DOT_FACTS_JSON), )