MCPcopy Create free account
hub / github.com/Likhithsai2580/JARVIS / github_function

Function github_function

extensions/github.py:127–163  ·  view source on GitHub ↗
(action, *args)

Source from the content-addressed store, hash-verified

125
126
127def 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)}"

Callers

nothing calls this directly

Calls 7

search_github_reposFunction · 0.85
clone_repositoryFunction · 0.85
upload_to_githubFunction · 0.85
create_repoFunction · 0.85
get_commitsFunction · 0.85
get_issuesFunction · 0.85
get_repos_owned_by_ownerFunction · 0.85

Tested by

no test coverage detected