(action, *args)
| 125 | |
| 126 | |
| 127 | def github_function(action, *args): |
| 128 | try: |
| 129 | # Replace 'YOUR_ACCESS_TOKEN' with your actual GitHub access token |
| 130 | g = Github("access_token") |
| 131 | |
| 132 | if action == 'search_repos': |
| 133 | query, max_results = args |
| 134 | return search_github_repos(g, query, max_results) |
| 135 | |
| 136 | elif action == 'clone_repo': |
| 137 | repo_url, destination_folder = args |
| 138 | return clone_repository(repo_url, destination_folder) |
| 139 | |
| 140 | elif action == 'upload_to_github': |
| 141 | project_dir, repo_name, commit_message = args |
| 142 | return upload_to_github(project_dir, repo_name, commit_message) |
| 143 | |
| 144 | elif action == 'create_repo': |
| 145 | repo_name, description = args |
| 146 | return create_repo(g, repo_name, description) |
| 147 | |
| 148 | elif action == 'get_commits': |
| 149 | repo_name = args[0] |
| 150 | return get_commits(g, repo_name) |
| 151 | |
| 152 | elif action == 'get_issues': |
| 153 | repo_name = args[0] |
| 154 | return get_issues(g, repo_name) |
| 155 | |
| 156 | elif action == 'get_repos_owned_by_owner': |
| 157 | return get_repos_owned_by_owner(g) |
| 158 | |
| 159 | else: |
| 160 | return "Invalid action specified." |
| 161 | |
| 162 | except Exception as e: |
| 163 | return f"An error occurred: {str(e)}" |
nothing calls this directly
no test coverage detected