Skip to content

Commit b6dca75

Browse files
mtorpjdalton
authored andcommitted
exclude .socket.facts.json from socket fix manifest upload
1 parent 6ab5d0f commit b6dca75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/commands/fix/coana-fix.mts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { promises as fs } from 'node:fs'
22
import os from 'node:os'
33
import path from 'node:path'
44

5+
import { DOT_SOCKET_DOT_FACTS_JSON } from '../../constants.mts'
56
import { joinAnd } from '@socketsecurity/registry/lib/arrays'
67
import { debugDir, debugFn } from '@socketsecurity/registry/lib/debug'
78
import { readJsonSync } from '@socketsecurity/registry/lib/fs'
@@ -88,8 +89,13 @@ export async function coanaFix(
8889
const scanFilepaths = await getPackageFilesForScan(['.'], supportedFiles, {
8990
cwd,
9091
})
92+
// Exclude any .socket.facts.json files that happen to be in the scan
93+
// folder before the analysis was run.
94+
const filepathsToUpload = scanFilepaths.filter(
95+
p => path.basename(p).toLowerCase() !== DOT_SOCKET_DOT_FACTS_JSON,
96+
)
9197
const uploadCResult = await handleApiCall(
92-
sockSdk.uploadManifestFiles(orgSlug, scanFilepaths),
98+
sockSdk.uploadManifestFiles(orgSlug, filepathsToUpload),
9399
{
94100
description: 'upload manifests',
95101
spinner,

0 commit comments

Comments
 (0)