diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dae106f5..fae196516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [1.1.86](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.86) - 2026-04-24 + +### Changed +- `socket fix` now fails with a clear error when a `.socket.facts.json` analysis artifact is present alongside manifest files, prompting you to delete it before re-running + ## [1.1.85](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.85) - 2026-04-20 ### Changed diff --git a/package.json b/package.json index 78ed805a7..babaa2517 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "socket", - "version": "1.1.85", + "version": "1.1.86", "description": "CLI for Socket.dev", "homepage": "https://github.com/SocketDev/socket-cli", "license": "MIT AND OFL-1.1", diff --git a/src/commands/fix/coana-fix.mts b/src/commands/fix/coana-fix.mts index 144799305..d68d65e43 100644 --- a/src/commands/fix/coana-fix.mts +++ b/src/commands/fix/coana-fix.mts @@ -169,13 +169,25 @@ export async function coanaFix( config: socketConfig, cwd, }) - // Exclude any .socket.facts.json files that happen to be in the scan - // folder before the analysis was run. - const filepathsToUpload = scanFilepaths.filter( - p => path.basename(p).toLowerCase() !== DOT_SOCKET_DOT_FACTS_JSON, + // Fail if any .socket.facts.json files are present in the scan folder. + // These are analysis artifacts and must be removed before re-running fix. + const factsFiles = scanFilepaths.filter( + p => path.basename(p).toLowerCase() === DOT_SOCKET_DOT_FACTS_JSON, ) + if (factsFiles.length) { + if (!silence) { + spinner?.stop() + } + return { + ok: false, + message: `Found ${DOT_SOCKET_DOT_FACTS_JSON} in manifest files`, + cause: + `Delete the following ${pluralize('file', factsFiles.length)} before running socket fix again:\n` + + factsFiles.map(p => ` - ${p}`).join('\n'), + } + } const uploadCResult = await handleApiCall( - sockSdk.uploadManifestFiles(orgSlug, filepathsToUpload, cwd), + sockSdk.uploadManifestFiles(orgSlug, scanFilepaths, cwd), { description: 'upload manifests', spinner,