Skip to content

Commit 2b96caf

Browse files
committed
Add support for --workspace flag
Signed-off-by: lelia <lelia@socket.dev>
1 parent 38c064d commit 2b96caf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

socketsecurity/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class CliConfig:
6666
save_manifest_tar: Optional[str] = None
6767
sub_paths: List[str] = field(default_factory=list)
6868
workspace_name: Optional[str] = None
69+
workspace: Optional[str] = None
6970
# Reachability Flags
7071
reach: bool = False
7172
reach_version: Optional[str] = None
@@ -144,6 +145,7 @@ def from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig':
144145
'save_manifest_tar': args.save_manifest_tar,
145146
'sub_paths': args.sub_paths or [],
146147
'workspace_name': args.workspace_name,
148+
'workspace': args.workspace,
147149
'slack_webhook': args.slack_webhook,
148150
'reach': args.reach,
149151
'reach_version': args.reach_version,
@@ -254,6 +256,12 @@ def create_argument_parser() -> argparse.ArgumentParser:
254256
help="Repository name in owner/repo format",
255257
required=False
256258
)
259+
repo_group.add_argument(
260+
"--workspace",
261+
metavar="<string>",
262+
help="The workspace of the repository to associate the full-scan with.",
263+
required=False
264+
)
257265
repo_group.add_argument(
258266
"--repo-is-public",
259267
dest="repo_is_public",

socketsecurity/socketcli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def main_code():
464464
make_default_branch=is_default_branch,
465465
set_as_pending_head=is_default_branch,
466466
tmp=False,
467-
scan_type='socket_tier1' if config.reach else 'socket'
467+
scan_type='socket_tier1' if config.reach else 'socket',
468+
workspace=config.workspace or None,
468469
)
469470

470471
params.include_license_details = not config.exclude_license_details

0 commit comments

Comments
 (0)