Data Loaders
Read files from GitHub
Node Inputs
The node requires the following inputs for its operation:
- repo name: The name of the GitHub repository from which to read files. It should be formatted as “user_name/repository_name”, for example, “Significant-Gravitas/AutoGPT”.
- folders: The specific paths within the repository from where the files should be read. These paths should be provided as a comma-separated list, like “docs/content/configuration, docs/content/challenges”.
- fileregex (_optional): A regular expression pattern used to filter the files within the provided folders. For example, ”.*.py” to select only Python files. If not provided, all files will be considered.
- branch (optional): The branch in the repository from which to read the files. If not specified, the default is the “main” branch.
Node Output
The node outputs the following:
- file names: A list containing the names of the files read from the GitHub repository.
- file contents: A list with the contents of each file read from the GitHub repository.
Node Functionality
This node access files from a specified GitHub repository including both public and private repositories, given the appropriate permissions. It fetches files from defined directories within the repository and can filter files based on a specified pattern (regular expression). The files can be sourced from any branch of the repository.
This node is also capable of handling multiple requests simultaneously (list processing) and is a critical component within an automation pipeline, often serving as a data input source.
When To Use
Utilize this node when you need to:
- Automatically retrieve code or documents from GitHub for analysis, builds, or backups.
- Read and process files from projects hosted on GitHub without manually downloading them.
- Fetch and process files from multiple folders within a repository at once.
- Selectively read files that match certain naming patterns or file types.
- Integrate reading files from a GitHub repository within a larger automated process.