@socketsecurity/cli-with-sentry 0.14.118 → 0.14.119

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.
@@ -917,7 +917,7 @@ function emitBanner(name) {
917
917
  logger.logger.error(getAsciiHeader(name))
918
918
  }
919
919
  function getAsciiHeader(command) {
920
- const cliVersion = '0.14.118:fb39c6f:26305ac3:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.119:4f7b6a8:bcd85d46:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
921
921
  const nodeVersion = process$1.version
922
922
  const apiToken = shadowNpmInject.getDefaultToken()
923
923
  const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
@@ -3817,12 +3817,9 @@ async function gitCreateAndPushBranchIfNeeded(
3817
3817
  cwd = process.cwd()
3818
3818
  ) {
3819
3819
  if (await gitBranchExists(branch, cwd)) {
3820
- logger.logger.warn(`Branch "${branch}" already exists. Skipping creation.`)
3821
- return false
3820
+ logger.logger.warn(`Branch "${branch}" already exists, skipping creation.`)
3821
+ return true
3822
3822
  }
3823
- await spawn.spawn('git', ['checkout', '-b', branch], {
3824
- cwd
3825
- })
3826
3823
  const moddedFilepaths = (await gitUnstagedModifiedFiles(cwd)).filter(p => {
3827
3824
  const basename = path$1.basename(p)
3828
3825
  return (
@@ -3831,11 +3828,16 @@ async function gitCreateAndPushBranchIfNeeded(
3831
3828
  basename === 'pnpm-lock.yaml'
3832
3829
  )
3833
3830
  })
3834
- if (moddedFilepaths.length) {
3835
- await spawn.spawn('git', ['add', ...moddedFilepaths], {
3836
- cwd
3837
- })
3831
+ if (!moddedFilepaths.length) {
3832
+ logger.logger.warn('Nothing to commit, skipping push.')
3833
+ return false
3838
3834
  }
3835
+ await spawn.spawn('git', ['checkout', '-b', branch], {
3836
+ cwd
3837
+ })
3838
+ await spawn.spawn('git', ['add', ...moddedFilepaths], {
3839
+ cwd
3840
+ })
3839
3841
  await spawn.spawn('git', ['commit', '-m', commitMsg], {
3840
3842
  cwd
3841
3843
  })
@@ -4216,13 +4218,16 @@ async function npmFix(
4216
4218
  error = e
4217
4219
  errored = true
4218
4220
  }
4219
- if (!errored && shouldOpenPr) {
4221
+ if (
4222
+ !errored &&
4223
+ shouldOpenPr &&
4220
4224
  // eslint-disable-next-line no-await-in-loop
4221
- await gitCreateAndPushBranchIfNeeded(
4225
+ (await gitCreateAndPushBranchIfNeeded(
4222
4226
  branch,
4223
4227
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4224
4228
  cwd
4225
- )
4229
+ ))
4230
+ ) {
4226
4231
  // eslint-disable-next-line no-await-in-loop
4227
4232
  const prResponse = await openGitHubPullRequest(
4228
4233
  owner,
@@ -4673,13 +4678,16 @@ async function pnpmFix(
4673
4678
  error = e
4674
4679
  errored = true
4675
4680
  }
4676
- if (!errored && shouldOpenPr) {
4681
+ if (
4682
+ !errored &&
4683
+ shouldOpenPr &&
4677
4684
  // eslint-disable-next-line no-await-in-loop
4678
- await gitCreateAndPushBranchIfNeeded(
4685
+ (await gitCreateAndPushBranchIfNeeded(
4679
4686
  branch,
4680
4687
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4681
4688
  cwd
4682
- )
4689
+ ))
4690
+ ) {
4683
4691
  // eslint-disable-next-line no-await-in-loop
4684
4692
  const prResponse = await openGitHubPullRequest(
4685
4693
  owner,
@@ -12300,7 +12308,7 @@ void (async () => {
12300
12308
  await vendor.updater({
12301
12309
  name: SOCKET_CLI_BIN_NAME,
12302
12310
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12303
- version: '0.14.118',
12311
+ version: '0.14.119',
12304
12312
  ttl: 86_400_000 /* 24 hours in milliseconds */
12305
12313
  })
12306
12314
  try {
@@ -12368,5 +12376,5 @@ void (async () => {
12368
12376
  await shadowNpmInject.captureException(e)
12369
12377
  }
12370
12378
  })()
12371
- //# debugId=a562420c-f066-44bd-9943-52776a7de105
12379
+ //# debugId=451e4d23-1f70-43f5-92f6-ed127d74f7d7
12372
12380
  //# sourceMappingURL=cli.js.map