Skip to content

Commit e3d8dc3

Browse files
committed
Added repo visibility to shared config
1 parent f114f9a commit e3d8dc3

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.0.54"
9+
version = "2.0.55"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.0.54'
2+
__version__ = '2.0.55'

socketsecurity/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
150150
)
151151
repo_group.add_argument(
152152
"--repo-is-public",
153-
dest="default_branch",
153+
dest="repo_is_public",
154154
action="store_true",
155155
help="If set it will flag a new repository creation as public. Defaults to false."
156156
)

socketsecurity/core/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,12 @@ def get_repo_info(self, repo_slug: str, default_branch: str = "socket-default-br
439439
log.warning(f"Failed to get repository {repo_slug}, attempting to create it")
440440
try:
441441

442-
create_response = self.sdk.repos.post(self.config.org_slug, name=repo_slug, default_branch=default_branch)
442+
create_response = self.sdk.repos.post(
443+
self.config.org_slug,
444+
name=repo_slug,
445+
default_branch=default_branch,
446+
visibility=self.config.repo_visibility
447+
)
443448

444449
# Check if the response is empty (failure) or has content (success)
445450
if not create_response:

socketsecurity/core/socket_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class SocketConfig:
2626
full_scan_path: Optional[str] = None
2727
repository_path: Optional[str] = None
2828
security_policy: Dict = None
29+
repo_visibility: Optional[str] = 'private'
2930
all_issues: Optional['AllIssues'] = None
3031
excluded_dirs: Set[str] = field(default_factory=lambda: default_exclude_dirs)
3132
version: str = __version__

socketsecurity/socketcli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def main_code():
148148
log.debug("Found manifest files or forced scan, proceeding")
149149

150150
org_slug = core.config.org_slug
151+
if config.repo_is_public:
152+
core.config.repo_visibility = "public"
151153
integration_type = config.integration_type
152154
integration_org_slug = config.integration_org_slug or org_slug
153155
try:

0 commit comments

Comments
 (0)