Spaces:
Running
on
Zero
Running
on
Zero
import os | |
import github | |
from github_repo import GitHubRepo | |
def upload_files(token: str, repo_name: str, files: list) -> None: | |
"""Uploads a list of files to a GitHub repository""" | |
g = github.Github(token) | |
repo = g.get_repo(repo_name) | |
for file in files: | |
with open(file, 'rb') as f: | |
repo.create_file(file, f.read(), 'Initial commit') |