@socketsecurity/cli-with-sentry 0.15.1 → 0.15.2

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.
package/dist/cli.js CHANGED
@@ -3642,8 +3642,9 @@ let _octokit
3642
3642
  function getOctokit() {
3643
3643
  if (_octokit === undefined) {
3644
3644
  _octokit = new vendor.Octokit({
3645
- // Lazily access constants.ENV.SOCKET_SECURITY_GITHUB_PAT.
3646
- auth: constants.ENV.SOCKET_SECURITY_GITHUB_PAT
3645
+ // Lazily access constants.ENV properties.
3646
+ auth:
3647
+ constants.ENV.SOCKET_SECURITY_GITHUB_PAT || constants.ENV.GITHUB_TOKEN
3647
3648
  })
3648
3649
  }
3649
3650
  return _octokit
@@ -3653,8 +3654,8 @@ function getOctokitGraphql() {
3653
3654
  if (!_octokitGraphql) {
3654
3655
  _octokitGraphql = vendor.graphql2.defaults({
3655
3656
  headers: {
3656
- // Lazily access constants.ENV.SOCKET_SECURITY_GITHUB_PAT.
3657
- authorization: `token ${constants.ENV.SOCKET_SECURITY_GITHUB_PAT}`
3657
+ // Lazily access constants.ENV properties.
3658
+ authorization: `token ${constants.ENV.SOCKET_SECURITY_GITHUB_PAT || constants.ENV.GITHUB_TOKEN}`
3658
3659
  }
3659
3660
  })
3660
3661
  }
@@ -3921,12 +3922,10 @@ async function openPr(owner, repo, branch, purl, newVersion, options) {
3921
3922
  }
3922
3923
  // Lazily access constants.ENV.GITHUB_ACTIONS.
3923
3924
  if (constants.ENV.GITHUB_ACTIONS) {
3924
- // Lazily access constants.ENV.SOCKET_SECURITY_GITHUB_PAT.
3925
- const pat = constants.ENV.SOCKET_SECURITY_GITHUB_PAT
3926
- if (!pat) {
3927
- throw new Error('Missing SOCKET_SECURITY_GITHUB_PAT environment variable')
3928
- }
3929
- const url = `https://x-access-token:${pat}@github.com/${owner}/${repo}`
3925
+ // Lazily access constants.ENV properties.
3926
+ const token =
3927
+ constants.ENV.SOCKET_SECURITY_GITHUB_PAT || constants.ENV.GITHUB_TOKEN
3928
+ const url = `https://x-access-token:${token}@github.com/${owner}/${repo}`
3930
3929
  await spawn.spawn('git', ['remote', 'set-url', 'origin', url], {
3931
3930
  cwd
3932
3931
  })
@@ -12253,5 +12252,5 @@ void (async () => {
12253
12252
  await utils.captureException(e)
12254
12253
  }
12255
12254
  })()
12256
- //# debugId=abfabeab-23a3-4c14-b82b-b4de769ddb01
12255
+ //# debugId=be4d8ec9-d96e-4493-bf32-4c821a11160f
12257
12256
  //# sourceMappingURL=cli.js.map