Skip to content

Commit f1c68cd

Browse files
committed
add update_github_repo
1 parent 51aba67 commit f1c68cd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

openpecha/github_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ def get_github_repo(repo_name, org_name, token):
3232

3333
def create_github_repo(path, org_name, token, private=False):
3434
org = _get_openpecha_data_org(org_name, token)
35-
repo = org.create_repo(path.name, private)
35+
visibility = "private" if private else "public"
36+
repo = org.create_repo(path.name, private=private, visibility=visibility, has_wiki=False, has_projects=False)
3637
time.sleep(2)
3738
return repo._html_url.value
3839

3940

41+
def update_github_repo(repo_name, org_name, token, private=False):
42+
org = _get_openpecha_data_org(org_name, token)
43+
repo = org.get_repo(repo_name)
44+
repo.edit(private=private)
45+
46+
4047
def commit(repo_path, message, not_includes, branch="master"):
4148
if isinstance(repo_path, Repo):
4249
repo = repo_path

0 commit comments

Comments
 (0)