Spaces:
Running
on
Zero
Running
on
Zero
import os | |
import github | |
from dataclasses import dataclass | |
class GitHubRepo: | |
"""Represents a GitHub repository""" | |
name: str | |
description: str | |
private: bool | |
def create_repo(token: str, repo: GitHubRepo) -> str: | |
"""Creates a new GitHub repository""" | |
g = github.Github(token) | |
repo = g.get_user().create_repo(repo.name, repo.description, private=repo.private) | |
return repo.html_url |