def METHOD_NAME(args):
    last_commit_sha = None
    if not args.to_ref:
        raise UploadFileToGithubException("Need a to-ref args")
    if not args.filename:
        raise UploadFileToGithubException("Need at least one filename")
    # Get last commit SHA of a branch
    _, jeez = github_request(
        args.token, "GET", f"/repos/{args.owner_repository}/git/{args.to_ref}"
    )
    last_commit_sha = jeez["object"]["sha"]
    for entry in args.filename:
        left, dest = entry.split(":")
        content: str = ""
        if os.path.exists(left):
            with open(left, "r", encoding="utf-8") as f:
                content: str = f.read()
            print(
                f"Uploading file {left} to destination {dest} based on {last_commit_sha}"
            )
        else:
            content: str = left.strip()
            print(
                f"Setting value {left} into the destionation {dest} based on {last_commit_sha}"
            )
        base64content = base64.b64encode(content.encode())
        _, jeez = github_request(
            args.token,
            "POST",
            f"/repos/{args.owner_repository}/git/blobs",
            data={"content": base64content.decode(), "encoding": "base64"},
        )
        blob_content_sha = jeez["sha"]
        _, jeez = github_request(
            args.token,
            "POST",
            f"/repos/{args.owner_repository}/git/trees",
            data={
                "base_tree": last_commit_sha,
                "tree": [
                    {
                        "path": dest,
                        "mode": "100644",
                        "type": "blob",
                        "sha": blob_content_sha,
                    }
                ],
            },
        )
        tree_sha = jeez["sha"]
        _, jeez = github_request(
            args.token,
            "POST",
            f"/repos/{args.owner_repository}/git/commits",
            data={
                "message": args.message,
                "author": {
                    "name": GIT_NAME,
                    "email": GIT_EMAIL,
                },
                "parents": [last_commit_sha],
                "tree": tree_sha,
            },
        )
        last_commit_sha = jeez["sha"]
        print(f"Last commit SHA: {last_commit_sha}")
        time.sleep(30)
        _, jeez = github_request(
            args.token,
            "PATCH",
            f"/repos/{args.owner_repository}/git/{args.to_ref}",
            data={"sha": last_commit_sha},
        )
    return last_commit_sha