@socketsecurity/cli 0.14.72 → 0.14.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -911,7 +911,7 @@ function emitBanner(name) {
911
911
  logger.logger.error(getAsciiHeader(name))
912
912
  }
913
913
  function getAsciiHeader(command) {
914
- const cliVersion = '0.14.72:f9c998c:61b1fa9f:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
914
+ const cliVersion = '0.14.74:e430910:f7329bae:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
915
915
  const nodeVersion = process$1.version
916
916
  const apiToken = shadowNpmInject.getDefaultToken()
917
917
  const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
@@ -3168,6 +3168,10 @@ async function commitAndPushFix(branchName, commitMsg, cwd) {
3168
3168
  )
3169
3169
  return
3170
3170
  }
3171
+ const baseBranch = process.env['GITHUB_REF_NAME'] ?? 'main'
3172
+ await spawn.spawn('git', ['checkout', baseBranch], {
3173
+ cwd
3174
+ })
3171
3175
  await spawn.spawn('git', ['checkout', '-b', branchName], {
3172
3176
  cwd
3173
3177
  })
@@ -3192,6 +3196,7 @@ async function createPullRequest({
3192
3196
  const octokit = new vendor.Octokit({
3193
3197
  auth: process.env['SOCKET_AUTOFIX_PAT'] ?? process.env['GITHUB_TOKEN']
3194
3198
  })
3199
+ await new Promise(resolve => setTimeout(resolve, 3000)) // 3s
3195
3200
  await octokit.pulls.create({
3196
3201
  owner,
3197
3202
  repo,
@@ -3337,6 +3342,19 @@ async function pnpmFix(pkgEnvDetails, options) {
3337
3342
  const commitMsg = `fix: upgrade ${name} to ${targetVersion}`
3338
3343
  const { owner, repo } = getRepoInfo()
3339
3344
  // eslint-disable-next-line no-await-in-loop
3345
+ await spawn.spawn(
3346
+ 'git',
3347
+ [
3348
+ 'remote',
3349
+ 'set-url',
3350
+ 'origin',
3351
+ `https://x-access-token:${process.env['SOCKET_AUTOFIX_PAT']}@github.com/${owner}/${repo}`
3352
+ ],
3353
+ {
3354
+ cwd
3355
+ }
3356
+ )
3357
+ // eslint-disable-next-line no-await-in-loop
3340
3358
  await commitAndPushFix(branchName, commitMsg, cwd)
3341
3359
  // eslint-disable-next-line no-await-in-loop
3342
3360
  await createPullRequest({
@@ -11011,7 +11029,7 @@ void (async () => {
11011
11029
  await vendor.updater({
11012
11030
  name: SOCKET_CLI_BIN_NAME,
11013
11031
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11014
- version: '0.14.72',
11032
+ version: '0.14.74',
11015
11033
  ttl: 86_400_000 /* 24 hours in milliseconds */
11016
11034
  })
11017
11035
  try {
@@ -11082,5 +11100,5 @@ void (async () => {
11082
11100
  await shadowNpmInject.captureException(e)
11083
11101
  }
11084
11102
  })()
11085
- //# debugId=33e85141-a6e9-4dd0-bee4-3632ad098355
11103
+ //# debugId=8562d87a-0415-4a13-91e9-b5bcf344b3d3
11086
11104
  //# sourceMappingURL=cli.js.map