Skip to content

Commit

Permalink
@W-14865432 - Create private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vsbharath committed Jan 23, 2024
1 parent 0728e2b commit 0ec51b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,6 @@ def safe_key() -> str:
dsn=SENTRY_DSN,
integrations=[DjangoIntegration(), RedisIntegration(), RqIntegration()],
)

# create private repo
ENABLE_CREATE_PRIVATE_REPO = env.bool("ENABLE_CREATE_PRIVATE_REPO", default=True)
4 changes: 2 additions & 2 deletions metecho/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def create_repository(
"name": project.repo_name,
"description": project.description,
"include_all_branches": False,
"private": False,
"private": settings.ENABLE_CREATE_PRIVATE_REPO,
}
# Sending a POST request to GitHub API
response = requests.post(api_url, headers=headers, json=github_data)
Expand All @@ -273,7 +273,7 @@ def create_repository(

else:
repo = org.create_repository(
project.repo_name, description=project.description, private=False
project.repo_name, description=project.description, private=settings.ENABLE_CREATE_PRIVATE_REPO
)
team.add_repository(repo.full_name, permission="push")
project.repo_id = repo.id
Expand Down

0 comments on commit 0ec51b9

Please sign in to comment.