Module: github
github_list_files(owner, repo, path, branch='main', type='file')
List all files (or directories) in a GitHub repo path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner |
str
|
The owner of the repository. |
required |
repo |
str
|
The repository name. |
required |
path |
str
|
The path to list files from. |
required |
branch |
str
|
The branch to list files from. Defaults to "main". |
'main'
|
type |
str
|
"dir" or "file". Defaults to "file". |
'file'
|
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of file names. |
Source code in src/infernet_cli/github.py
github_pull_file(owner, repo, path, branch='main')
Retrieve a file's contents from Github
Parameters:
Name | Type | Description | Default |
---|---|---|---|
owner |
str
|
The owner of the repository. |
required |
repo |
str
|
The repository name. |
required |
path |
str
|
The path to the file. |
required |
branch |
str
|
The branch to pull the file from. Defaults to "main". |
'main'
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The file's contents. |