Skip to content

Commit 61bec03

Browse files
committed
Add SOCKET_CLI_GITHUB_API_URL env var
1 parent e09fb66 commit 61bec03

17 files changed

Lines changed: 105 additions & 94 deletions

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use of the `projectIgnorePaths` to excludes files when creating a report.
6363

6464
- `SOCKET_CLI_API_TOKEN` - Set the Socket API token
6565
- `SOCKET_CLI_CONFIG` - A JSON stringified Socket configuration object
66+
- `SOCKET_CLI_GITHUB_API_URL` - Change the base URL for GitHub REST API calls
6667
- `SOCKET_CLI_GIT_USER_EMAIL` - The git config `user.email` used by Socket CLI<br>
6768
*Defaults:* `github-actions[bot]@users.noreply.github.com`<br>
6869
- `SOCKET_CLI_GIT_USER_NAME` - The git config `user.name` used by Socket CLI<br>
@@ -89,7 +90,7 @@ npm exec socket
8990

9091
### Environment variables for development
9192

92-
- `SOCKET_CLI_API_BASE_URL` - Change the base URL for all API-calls<br>
93+
- `SOCKET_CLI_API_BASE_URL` - Change the base URL for Socket API calls<br>
9394
*Defaults:* The "apiBaseUrl" value of socket/settings local app data if present, else `https://api.socket.dev/v0/`<br>
9495
- `SOCKET_CLI_API_PROXY` - Set the proxy all requests are routed through, e.g. if set to<br>
9596
[`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries), then all request are passed through that proxy<br>

src/commands/manifest/cmd-manifest-auto.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { commonFlags } from '../../flags.mts'
1010
import { getOutputKind } from '../../utils/get-output-kind.mts'
1111
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1212
import { getFlagListOutput } from '../../utils/output-formatting.mts'
13-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
13+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
1414

1515
import type { CliCommandConfig } from '../../utils/meow-with-subcommands.mts'
1616

@@ -85,7 +85,7 @@ async function run(
8585
logger.groupEnd()
8686
}
8787

88-
const sockJson = await readOrDefaultSocketJson(cwd)
88+
const sockJson = readOrDefaultSocketJson(cwd)
8989

9090
const detected = await detectManifestActions(sockJson, cwd)
9191
debugDir('inspect', { detected })

src/commands/manifest/cmd-manifest-conda.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { checkCommandInput } from '../../utils/check-input.mts'
99
import { getOutputKind } from '../../utils/get-output-kind.mts'
1010
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1111
import { getFlagListOutput } from '../../utils/output-formatting.mts'
12-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
12+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
1313

1414
import type { CliCommandConfig } from '../../utils/meow-with-subcommands.mts'
1515

@@ -95,7 +95,7 @@ async function run(
9595
// If given path is absolute then cwd should not affect it.
9696
cwd = path.resolve(process.cwd(), cwd)
9797

98-
const sockJson = await readOrDefaultSocketJson(cwd)
98+
const sockJson = readOrDefaultSocketJson(cwd)
9999

100100
// Set defaults for any flag/arg that is not given. Check socket.json first.
101101
if (

src/commands/manifest/cmd-manifest-gradle.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { checkCommandInput } from '../../utils/check-input.mts'
1010
import { getOutputKind } from '../../utils/get-output-kind.mts'
1111
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1212
import { getFlagListOutput } from '../../utils/output-formatting.mts'
13-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
13+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
1414

1515
import type { CliCommandConfig } from '../../utils/meow-with-subcommands.mts'
1616

@@ -97,7 +97,7 @@ async function run(
9797
// If given path is absolute then cwd should not affect it.
9898
cwd = path.resolve(process.cwd(), cwd)
9999

100-
const sockJson = await readOrDefaultSocketJson(cwd)
100+
const sockJson = readOrDefaultSocketJson(cwd)
101101

102102
debugFn(
103103
'inspect',

src/commands/manifest/cmd-manifest-kotlin.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { checkCommandInput } from '../../utils/check-input.mts'
1010
import { getOutputKind } from '../../utils/get-output-kind.mts'
1111
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1212
import { getFlagListOutput } from '../../utils/output-formatting.mts'
13-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
13+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
1414

1515
import type { CliCommandConfig } from '../../utils/meow-with-subcommands.mts'
1616

@@ -102,7 +102,7 @@ async function run(
102102
// If given path is absolute then cwd should not affect it.
103103
cwd = path.resolve(process.cwd(), cwd)
104104

105-
const sockJson = await readOrDefaultSocketJson(cwd)
105+
const sockJson = readOrDefaultSocketJson(cwd)
106106

107107
debugFn(
108108
'inspect',

src/commands/manifest/cmd-manifest-scala.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { checkCommandInput } from '../../utils/check-input.mts'
1010
import { getOutputKind } from '../../utils/get-output-kind.mts'
1111
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
1212
import { getFlagListOutput } from '../../utils/output-formatting.mts'
13-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
13+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
1414

1515
import type { CliCommandConfig } from '../../utils/meow-with-subcommands.mts'
1616

@@ -110,7 +110,7 @@ async function run(
110110
// If given path is absolute then cwd should not affect it.
111111
cwd = path.resolve(process.cwd(), cwd)
112112

113-
const sockJson = await readOrDefaultSocketJson(cwd)
113+
const sockJson = readOrDefaultSocketJson(cwd)
114114

115115
debugFn(
116116
'inspect',

src/commands/manifest/detect-manifest-actions.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import path from 'node:path'
66

77
import { debugLog } from '@socketsecurity/registry/lib/debug'
88

9-
import type { SocketJson } from '../../utils/socketjson.mts'
9+
import type { SocketJson } from '../../utils/socket-json.mts'
1010

1111
export interface GeneratableManifests {
1212
cdxgen: boolean

src/commands/manifest/generate_auto_manifest.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { logger } from '@socketsecurity/registry/lib/logger'
55
import { convertGradleToMaven } from './convert_gradle_to_maven.mts'
66
import { convertSbtToMaven } from './convert_sbt_to_maven.mts'
77
import { handleManifestConda } from './handle-manifest-conda.mts'
8-
import { readOrDefaultSocketJson } from '../../utils/socketjson.mts'
8+
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
99

1010
import type { GeneratableManifests } from './detect-manifest-actions.mts'
1111
import type { OutputKind } from '../../types.mts'
@@ -21,7 +21,7 @@ export async function generateAutoManifest({
2121
outputKind: OutputKind
2222
verbose: boolean
2323
}) {
24-
const sockJson = await readOrDefaultSocketJson(cwd)
24+
const sockJson = readOrDefaultSocketJson(cwd)
2525

2626
if (verbose) {
2727
logger.info('Using this socket.json for defaults:', sockJson)

src/commands/manifest/setup-manifest-config.mts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import { logger } from '@socketsecurity/registry/lib/logger'
66
import { input, select } from '@socketsecurity/registry/lib/prompts'
77

88
import { detectManifestActions } from './detect-manifest-actions.mts'
9-
import { readSocketJson, writeSocketJson } from '../../utils/socketjson.mts'
9+
import {
10+
readSocketJsonSync,
11+
writeSocketJson,
12+
} from '../../utils/socket-json.mts'
1013

1114
import type { CResult } from '../../types.mts'
12-
import type { SocketJson } from '../../utils/socketjson.mts'
15+
import type { SocketJson } from '../../utils/socket-json.mts'
1316

1417
export async function setupManifestConfig(
1518
cwd: string,
@@ -106,11 +109,11 @@ export async function setupManifestConfig(
106109

107110
// TODO: Use detected to list those first.
108111
const targetEco = (await select({
109-
message: 'Select eco system manifest generator to configure',
112+
message: 'Select ecosystem manifest generator to configure',
110113
choices,
111114
})) as string | null
112115

113-
const sockJsonCResult = await readSocketJson(cwd, defaultOnReadError)
116+
const sockJsonCResult = readSocketJsonSync(cwd, defaultOnReadError)
114117
if (!sockJsonCResult.ok) {
115118
return sockJsonCResult
116119
}

src/commands/repository/fetch-list-all-repos.mts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { debugDir, debugFn } from '@socketsecurity/registry/lib/debug'
2-
31
import { handleApiCall } from '../../utils/api.mts'
42
import { setupSdk } from '../../utils/sdk.mts'
53

0 commit comments

Comments
 (0)