@socketsecurity/cli-with-sentry 1.0.53 → 1.0.55
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
|
@@ -3105,11 +3105,15 @@ function getOctokit() {
|
|
|
3105
3105
|
if (!SOCKET_CLI_GITHUB_TOKEN) {
|
|
3106
3106
|
debug.debugFn('notice', 'miss: SOCKET_CLI_GITHUB_TOKEN env var');
|
|
3107
3107
|
}
|
|
3108
|
-
|
|
3108
|
+
const octokitOptions = {
|
|
3109
3109
|
auth: SOCKET_CLI_GITHUB_TOKEN,
|
|
3110
3110
|
// Lazily access constants.ENV.GITHUB_API_URL.
|
|
3111
3111
|
baseUrl: constants.ENV.GITHUB_API_URL
|
|
3112
|
+
};
|
|
3113
|
+
debug.debugDir('inspect', {
|
|
3114
|
+
octokitOptions
|
|
3112
3115
|
});
|
|
3116
|
+
_octokit = new vendor.Octokit(octokitOptions);
|
|
3113
3117
|
}
|
|
3114
3118
|
return _octokit;
|
|
3115
3119
|
}
|
|
@@ -3429,14 +3433,18 @@ async function openPr(owner, repo, branch, purl, newVersion, options) {
|
|
|
3429
3433
|
const purlObj = utils.getPurlObject(purl);
|
|
3430
3434
|
const octokit = getOctokit();
|
|
3431
3435
|
try {
|
|
3432
|
-
|
|
3436
|
+
const octokitPullsCreateParams = {
|
|
3433
3437
|
owner,
|
|
3434
3438
|
repo,
|
|
3435
3439
|
title: getSocketPullRequestTitle(purlObj, newVersion, workspace),
|
|
3436
3440
|
head: branch,
|
|
3437
3441
|
base: baseBranch,
|
|
3438
3442
|
body: getSocketPullRequestBody(purlObj, newVersion, workspace)
|
|
3443
|
+
};
|
|
3444
|
+
debug.debugDir('inspect', {
|
|
3445
|
+
octokitPullsCreateParams
|
|
3439
3446
|
});
|
|
3447
|
+
return await octokit.pulls.create(octokitPullsCreateParams);
|
|
3440
3448
|
} catch (e) {
|
|
3441
3449
|
let message = `Failed to open pull request`;
|
|
3442
3450
|
const errors = e instanceof vendor.RequestError ? e.response?.data?.['errors'] : undefined;
|
|
@@ -3925,6 +3933,8 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3925
3933
|
// eslint-disable-next-line no-await-in-loop
|
|
3926
3934
|
(await utils.gitCreateBranch(branch, cwd)) && (
|
|
3927
3935
|
// eslint-disable-next-line no-await-in-loop
|
|
3936
|
+
await utils.gitCheckoutBranch(branch, cwd)) && (
|
|
3937
|
+
// eslint-disable-next-line no-await-in-loop
|
|
3928
3938
|
await utils.gitCommit(getSocketCommitMessage(oldPurl, newVersion, workspace),
|
|
3929
3939
|
// eslint-disable-next-line no-await-in-loop
|
|
3930
3940
|
await getModifiedFiles(cwd), {
|
|
@@ -11296,7 +11306,9 @@ async function downloadManifestFile({
|
|
|
11296
11306
|
}) {
|
|
11297
11307
|
debug.debugFn('notice', 'request: download url from GitHub');
|
|
11298
11308
|
const fileUrl = `${repoApiUrl}/contents/${file}?ref=${defaultBranch}`;
|
|
11299
|
-
debug.
|
|
11309
|
+
debug.debugDir('inspect', {
|
|
11310
|
+
fileUrl
|
|
11311
|
+
});
|
|
11300
11312
|
const downloadUrlResponse = await fetch(fileUrl, {
|
|
11301
11313
|
method: 'GET',
|
|
11302
11314
|
headers: {
|
|
@@ -11379,7 +11391,7 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
|
|
|
11379
11391
|
};
|
|
11380
11392
|
} catch (error) {
|
|
11381
11393
|
logger.logger.fail('An error was thrown while trying to download a manifest file... url:', downloadUrl);
|
|
11382
|
-
debug.
|
|
11394
|
+
debug.debugDir('inspect', {
|
|
11383
11395
|
error
|
|
11384
11396
|
});
|
|
11385
11397
|
|
|
@@ -11514,7 +11526,9 @@ async function getRepoDetails({
|
|
|
11514
11526
|
repoSlug
|
|
11515
11527
|
}) {
|
|
11516
11528
|
const repoApiUrl = `${githubApiUrl}/repos/${orgGithub}/${repoSlug}`;
|
|
11517
|
-
debug.
|
|
11529
|
+
debug.debugDir('inspect', {
|
|
11530
|
+
repoApiUrl
|
|
11531
|
+
});
|
|
11518
11532
|
const repoDetailsResponse = await fetch(repoApiUrl, {
|
|
11519
11533
|
method: 'GET',
|
|
11520
11534
|
headers: {
|
|
@@ -11599,7 +11613,11 @@ async function getRepoBranchTree({
|
|
|
11599
11613
|
};
|
|
11600
11614
|
}
|
|
11601
11615
|
if (!treeDetails.tree || !Array.isArray(treeDetails.tree)) {
|
|
11602
|
-
debug.
|
|
11616
|
+
debug.debugDir('inspect', {
|
|
11617
|
+
treeDetails: {
|
|
11618
|
+
tree: treeDetails.tree
|
|
11619
|
+
}
|
|
11620
|
+
});
|
|
11603
11621
|
return {
|
|
11604
11622
|
ok: false,
|
|
11605
11623
|
message: `Tree response for default branch ${defaultBranch} for ${orgGithub}/${repoSlug} was not a list`
|
|
@@ -14140,5 +14158,5 @@ void (async () => {
|
|
|
14140
14158
|
await utils.captureException(e);
|
|
14141
14159
|
}
|
|
14142
14160
|
})();
|
|
14143
|
-
//# debugId=
|
|
14161
|
+
//# debugId=12bf55ed-6b06-47fb-a3d0-45e4d877da4e
|
|
14144
14162
|
//# sourceMappingURL=cli.js.map
|