GitHub Repository
This component acts as a bridge between your Nappai automation system and GitHub. It is designed to help you retrieve information about repositories associated with your GitHub account. Specifically, it is currently configured to perform operations that list repositories, allowing you to view and manage data from your GitHub profile within your workflows.
How it Works
This component connects to the GitHub API to fetch data regarding repositories. When you configure it, you are essentially telling Nappai to ask GitHub for a list of repositories that match specific criteria (such as your username or organization).
The component handles the technical communication with GitHub’s servers. You provide the necessary identification (via credentials) and any specific filters (like how many repositories you want to see), and the component returns this information in a structured format that other parts of your workflow can use.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type GitHub API and fill in the required fields (specifically, a GitHub Personal Access Token generated from your GitHub developer settings with repo scope).
- In your workflow, select the saved credential in the Credential input field of this node.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- List Repositories: Retrieves a list of repositories from your GitHub account. This is useful when you need to access information about your repositories or when other downstream tasks require a list of repository names or IDs.
To use the component, first select the operation you need in the “Operation” field.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
- Operation: Select the operation to perform.
- Visible in: List Repositories
- Repository Limit: Maximum number of repositories to retrieve (default: 100, max: 1000).
- Visible in: List Repositories
- Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: List Repositories
- Tool Name: The name of the tool that will be used when this component is connected as a tool. This name will be displayed to the agent when it selects tools to use.
- Visible in: List Repositories
- Tool Description: A detailed description of what this tool does. This description will help the agent understand when and how to use this tool effectively.
- Visible in: List Repositories
- Tools arguments metadata: Defines the arguments metadata for the tools.
- Visible in: List Repositories
Outputs
This component produces data that can be used in subsequent steps of your automation.
- Data: Contains the information retrieved from GitHub, such as a list of repository details. You can connect this output to other components that need to process or display this repository information.
- Tool: Exposes the component as a tool, allowing AI agents or other automated systems to invoke this functionality directly in future interactions.
Output Data Example (JSON)
json { “repositories”: [ { “name”: “my-project-alpha”, “owner”: “user123”, “private”: false, “description”: “A sample repository for testing”, “updated_at”: “2023-10-01T12:00:00Z” }, { “name”: “internal-docs”, “owner”: “user123”, “private”: true, “description”: “Documentation for internal use”, “updated_at”: “2023-09-15T09:30:00Z” } ], “total_count”: 2 }
Connectivity
This component is typically used at the beginning of a workflow where you need to gather information about your GitHub repositories. Its Data output is commonly connected to:
- Data Processing Components: Such as filters, formatters, or aggregators that need to analyze the list of repositories.
- Notification Systems: To send alerts or summaries about specific repositories.
- Database or Storage Nodes: To save the list of repositories for future reference.
It is rarely used at the end of a workflow unless you are exposing it as a tool for external agents.
Usage Example
Scenario: Listing Repositories for a Weekly Report
- Setup: Drag the GitHub Repository component into your canvas.
- Configure Credential: In the Credential field, select your pre-configured GitHub API credential.
- Select Operation: Choose List Repositories from the Operation dropdown.
- Set Limits: In the Repository Limit field, enter
10to retrieve only the 10 most recently updated repositories (or leave it at the default100for a broader list). - Connect: Connect the Data output of this component to a Formatter or Email component to display the list of repository names and their last update dates in a weekly email report.
Important Notes
⚠️ Component in Development 🟡 This component is marked as development and may lack full stability or support. Use with caution in production environments.
Tips and Best Practices
- Limit Your Requests: If you only need a small subset of repositories, use the Repository Limit input to reduce the amount of data processed, which improves workflow speed.
- Check Your Permissions: Ensure your GitHub Personal Access Token has the necessary scopes (like
repo) to access private repositories if your workflow requires them. - Use Mapping Mode Wisely: If you are processing a batch of data, enable Mapping Mode to handle multiple records efficiently, though note that the current List Repositories operation primarily handles single requests unless mapped data is provided.
Security Considerations
- Credential Security: Never share your GitHub Personal Access Token (PAT). Only configure it in the secure Credentials section of Nappai.
- Token Permissions: When generating your PAT, only grant the minimum necessary scopes (e.g.,
repo) to limit potential access if the token is compromised. - Development Status: Since this component is in development, avoid relying on it for critical financial or high-security operations until it is marked as stable.