File size: 367 Bytes
185f702
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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')