Skip to content

Commit 5b5ab3d

Browse files
committed
fix(scan): resolve TypeScript errors from merged PRs
Add missing reachMinSeverity property to reach configuration objects in handle-ci.mts and create-scan-from-github.mts. Convert spinner type from null to undefined using nullish coalescing in reachability analysis calls. Fix spawnSync usage in provider-factory.mts to handle Buffer/string stdout properly without encoding option. Related to PR #811 and PR #827.
1 parent 7384c16 commit 5b5ab3d

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

packages/cli/src/commands/ci/handle-ci.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export async function handleCi(autoManifest: boolean): Promise<void> {
5353
reachDisableAnalytics: false,
5454
reachEcosystems: [],
5555
reachExcludePaths: [],
56+
reachMinSeverity: '',
5657
reachSkipCache: false,
5758
runReachabilityAnalysis: false,
5859
},

packages/cli/src/commands/scan/create-scan-from-github.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ async function scanOneRepo(
258258
reachAnalysisMemoryLimit: 0,
259259
reachEcosystems: [],
260260
reachExcludePaths: [],
261+
reachMinSeverity: '',
261262
reachSkipCache: false,
262263
},
263264
readOnly: false,

packages/cli/src/commands/scan/handle-create-new-scan.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export async function handleCreateNewScan({
166166
packagePaths,
167167
reachabilityOptions: reach,
168168
repoName,
169-
spinner,
169+
spinner: spinner ?? undefined,
170170
target: targets[0]!,
171171
})
172172

packages/cli/src/commands/scan/handle-scan-reach.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function handleScanReach({
8181
outputPath,
8282
packagePaths,
8383
reachabilityOptions,
84-
spinner,
84+
spinner: spinner ?? undefined,
8585
target: targets[0]!,
8686
uploadManifests: true,
8787
})

packages/cli/src/utils/git/provider-factory.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ export function createPrProvider(): PrProvider {
3838
export function getGitRemoteUrlSync(): string {
3939
try {
4040
const result = spawnSync('git', ['config', '--get', 'remote.origin.url'], {
41-
encoding: 'utf8',
4241
stdio: ['pipe', 'pipe', 'pipe'],
4342
})
4443

4544
if (result.status === 0 && result.stdout) {
46-
return result.stdout.trim().toLowerCase()
45+
const remoteUrl =
46+
typeof result.stdout === 'string'
47+
? result.stdout
48+
: result.stdout.toString('utf8')
49+
return remoteUrl.trim().toLowerCase()
4750
}
4851
} catch {
4952
// Ignore errors - will fall back to GitHub.

0 commit comments

Comments
 (0)