diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c0ce9efc..10db764f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ 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.74](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.74) - 2026-03-19 + +### Fixed +- Fixed `socket scan create --reach` failing with input validation errors when no explicit target is passed. In non-TTY environments (e.g. Jenkins CI), the interactive prompt to confirm the current directory would silently fail, causing all reach validations to error. Now defaults to `.` (cwd) when `--reach` is used without a target. + +### Changed +- Updated the Coana CLI to v `14.12.200`. + ## [1.1.73](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.73) - 2026-03-13 ### Changed diff --git a/package.json b/package.json index daedeb34d..63013558f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "socket", - "version": "1.1.73", + "version": "1.1.74", "description": "CLI for Socket.dev", "homepage": "https://github.com/SocketDev/socket-cli", "license": "MIT AND OFL-1.1", @@ -97,7 +97,7 @@ "@babel/preset-typescript": "7.27.1", "@babel/runtime": "7.28.4", "@biomejs/biome": "2.2.4", - "@coana-tech/cli": "14.12.197", + "@coana-tech/cli": "14.12.200", "@cyclonedx/cdxgen": "12.1.2", "@dotenvx/dotenvx": "1.49.0", "@eslint/compat": "1.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e237a6482..a408d202a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ importers: specifier: 2.2.4 version: 2.2.4 '@coana-tech/cli': - specifier: 14.12.197 - version: 14.12.197 + specifier: 14.12.200 + version: 14.12.200 '@cyclonedx/cdxgen': specifier: 12.1.2 version: 12.1.2 @@ -740,8 +740,8 @@ packages: resolution: {integrity: sha512-hAs5PPKPCQ3/Nha+1fo4A4/gL85fIfxZwHPehsjCJ+BhQH2/yw6/xReuaPA/RfNQr6iz1PcD7BZcE3ctyyl3EA==} cpu: [x64] - '@coana-tech/cli@14.12.197': - resolution: {integrity: sha512-8dZWXf/GiUs7hUtZCDSXKXZhvD2YjvLjTxdAMpF6fZV+hpzT0g7BCC2fhZsHZM7mAEDAnVxn1eIHsJkKsqGnrw==} + '@coana-tech/cli@14.12.200': + resolution: {integrity: sha512-wLynNO4OhnfaqAi/XcmDEifmp0AjyN5wsLJZscDRTgscHSJ0XmYsNXQA118SNM+KtQo7JdVjX9ZWCIlm56FDxA==} hasBin: true '@colors/colors@1.5.0': @@ -5345,7 +5345,7 @@ snapshots: '@cdxgen/cdxgen-plugins-bin@2.0.2': optional: true - '@coana-tech/cli@14.12.197': {} + '@coana-tech/cli@14.12.200': {} '@colors/colors@1.5.0': optional: true diff --git a/src/commands/scan/cmd-scan-create.mts b/src/commands/scan/cmd-scan-create.mts index e48380864..ef02af35c 100644 --- a/src/commands/scan/cmd-scan-create.mts +++ b/src/commands/scan/cmd-scan-create.mts @@ -381,13 +381,22 @@ async function run( let updatedInput = false // Accept zero or more paths. Default to cwd() if none given. - let targets = cli.input || [cwd] + let targets = cli.input.length ? cli.input : [] if (!targets.length && !dryRun && interactive) { targets = await suggestTarget() updatedInput = true } + // Fallback: if targets is still empty after the interactive prompt (e.g. the + // select() prompt silently fails in non-TTY environments like Jenkins CI + // because wrapPrompt swallows non-TypeError errors and returns undefined), + // default to '.' so that downstream validations don't fail with confusing + // "At least one TARGET (missing)" errors. + if (!targets.length && !dryRun) { + targets = ['.'] + } + // We're going to need an api token to suggest data because those suggestions // must come from data we already know. Don't error on missing api token yet. // If the api-token is not set, ignore it for the sake of suggestions.