socket 1.0.36 → 1.0.37
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 +8 -12
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/fix/agent-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts +0 -2
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3479,6 +3479,7 @@ async function getSocketPrsWithContext(owner, repo, options) {
|
|
|
3479
3479
|
__proto__: null,
|
|
3480
3480
|
...options
|
|
3481
3481
|
};
|
|
3482
|
+
const branchPattern = getSocketBranchPattern(options);
|
|
3482
3483
|
const checkAuthor = strings.isNonEmptyString(author);
|
|
3483
3484
|
const octokit = getOctokit();
|
|
3484
3485
|
const octokitGraphql = getOctokitGraphql();
|
|
@@ -3518,8 +3519,8 @@ async function getSocketPrsWithContext(owner, repo, options) {
|
|
|
3518
3519
|
const node = nodes[i];
|
|
3519
3520
|
const login = node.author?.login;
|
|
3520
3521
|
const matchesAuthor = checkAuthor ? login === author : true;
|
|
3521
|
-
const
|
|
3522
|
-
if (matchesAuthor &&
|
|
3522
|
+
const matchesBranch = branchPattern.test(node.headRefName);
|
|
3523
|
+
if (matchesAuthor && matchesBranch) {
|
|
3523
3524
|
contextualMatches.push({
|
|
3524
3525
|
context: {
|
|
3525
3526
|
apiType: 'graphql',
|
|
@@ -3531,8 +3532,7 @@ async function getSocketPrsWithContext(owner, repo, options) {
|
|
|
3531
3532
|
},
|
|
3532
3533
|
match: {
|
|
3533
3534
|
...node,
|
|
3534
|
-
author: login ?? '<unknown>'
|
|
3535
|
-
parsedBranch
|
|
3535
|
+
author: login ?? '<unknown>'
|
|
3536
3536
|
}
|
|
3537
3537
|
});
|
|
3538
3538
|
}
|
|
@@ -3563,8 +3563,8 @@ async function getSocketPrsWithContext(owner, repo, options) {
|
|
|
3563
3563
|
const login = pr.user?.login;
|
|
3564
3564
|
const headRefName = pr.head.ref;
|
|
3565
3565
|
const matchesAuthor = checkAuthor ? login === author : true;
|
|
3566
|
-
const
|
|
3567
|
-
if (matchesAuthor &&
|
|
3566
|
+
const matchesBranch = branchPattern.test(headRefName);
|
|
3567
|
+
if (matchesAuthor && matchesBranch) {
|
|
3568
3568
|
// Upper cased mergeable_state is equivalent to mergeStateStatus.
|
|
3569
3569
|
// https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request
|
|
3570
3570
|
const mergeStateStatus = pr.mergeable_state?.toUpperCase?.() ?? 'UNKNOWN';
|
|
@@ -3587,7 +3587,6 @@ async function getSocketPrsWithContext(owner, repo, options) {
|
|
|
3587
3587
|
headRefName,
|
|
3588
3588
|
mergeStateStatus,
|
|
3589
3589
|
number: pr.number,
|
|
3590
|
-
parsedBranch,
|
|
3591
3590
|
state,
|
|
3592
3591
|
title: pr.title
|
|
3593
3592
|
}
|
|
@@ -3906,7 +3905,6 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3906
3905
|
const pkgPath = path.dirname(pkgJsonPath);
|
|
3907
3906
|
const isWorkspaceRoot = pkgJsonPath === pkgEnvDetails.editablePkgJson.filename;
|
|
3908
3907
|
const workspace = isWorkspaceRoot ? 'root' : path.relative(rootPath, pkgPath);
|
|
3909
|
-
const branchWorkspace = fixEnv.isCi ? getSocketBranchWorkspaceComponent(workspace) : '';
|
|
3910
3908
|
// actualTree may not be defined on the first iteration of pkgJsonPathsLoop.
|
|
3911
3909
|
if (!actualTree) {
|
|
3912
3910
|
if (!fixEnv.isCi) {
|
|
@@ -3980,9 +3978,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3980
3978
|
continue infosLoop;
|
|
3981
3979
|
}
|
|
3982
3980
|
const branch = getSocketBranchName(oldPurl, newVersion, workspace);
|
|
3983
|
-
const pr = prs.find(
|
|
3984
|
-
parsedBranch: b
|
|
3985
|
-
}) => b.workspace === branchWorkspace && b.newVersion === newVersion);
|
|
3981
|
+
const pr = prs.find(p => p.headRefName === branch);
|
|
3986
3982
|
if (pr) {
|
|
3987
3983
|
debug.debugFn('notice', `skip: PR #${pr.number} for ${name} exists`);
|
|
3988
3984
|
if (++count >= limit) {
|
|
@@ -14266,5 +14262,5 @@ void (async () => {
|
|
|
14266
14262
|
await utils.captureException(e);
|
|
14267
14263
|
}
|
|
14268
14264
|
})();
|
|
14269
|
-
//# debugId=
|
|
14265
|
+
//# debugId=66b4f897-caf8-4f1b-ac3a-1f9030377bf2
|
|
14270
14266
|
//# sourceMappingURL=cli.js.map
|