GitHub Integration Documentation
What the integration does
The GitHub integration enables interactions with GitHub repositories directly through the application. It allows users to perform various repository and issue management tasks without leaving the interface.
Short Description
The GitHub integration is designed to automate the management of repositories, issues, and pull requests on GitHub. It is typically used in scenarios where tracking, updating, and automating repository activities are necessary.
Example Scenarios
- Create and Manage Repositories: Automate the creation and management of repositories.
- Issue and Pull Request Management: Streamline tracking of issues and pull requests for better project management.
- Repository Insights: Gain insights into repository languages, branches, and more.
Capabilities
This integration supports the following capabilities:
- Search Repositories: Search public repositories based on query criteria.
- List Repositories: List all repositories for the authenticated user.
- Get Repository Details: Fetch detailed information about a specific repository.
- Create/Delete Repository: Create or delete a user or organizational repository.
- List Repository Languages: View the languages used in a repository.
- List Branches: List all branches in a repository.
- Manage Issues: Create, list, get details, comment, close/reopen, and assign/label issues.
- Manage Pull Requests: List PRs, get PR details, and view changes within a PR.
Input/Output Schemas for each capability
- Search Repositories
- Input:
{ "query": "string", "sort": "string", "order": "string", "page": "int", "per_page": "int" } - Output: JSON list of repositories matching the query.
- Input:
- List Repositories
- Output: JSON list of repository names.
- Create Repository
- Input:
{ "name": "string", "private": "bool", "description": "string", "auto_init": "bool", "organization": "string" } - Output: JSON object with repository details.
- Input:
- Get Repository Details
- Input:
{ "repo_name": "string" } - Output: JSON object with repository details. ... (and similar format for each other capability)
- Input:
Limitations
- Rate Limits: Bound by GitHub API rate limits.
- Access Restrictions: Requires appropriate permissions for certain operations, such as deleting repositories.
Setup & Configuration
Prerequisites
- GitHub account.
- GitHub Personal Access Token with required scopes for repository and issue management.
Authentication
- Use Access Tokens for authentication.
- Ensure GITHUB_ACCESS_TOKEN is set in the environment or passed into the integration.
Step-by-Step Guide
- Generate a GitHub Personal Access Token.
- Set the token as GITHUB_ACCESS_TOKEN in your environment variables.
Testing Connection
- Verify authentication by attempting to list user repositories.
How to Use in Agents
Example Prompt
- "Create a new GitHub repository named 'example-repo' and initialize it with a README."
Configuration Snippet
{
"integration_type": "github",
"actions": ["create_repository", "list_repositories"]
}```
### Best Practices
- Ensure you use descriptive repository names and follow GitHub's guidelines.
- Manage API rate limits effectively by optimizing requests.
### Reference Section
- **API Endpoints:** GitHub REST API v3
- **Schema Definitions:** Refer to GitHub's official API documentation for detailed schemas.
- [GitHub API Documentation](https://docs.github.com/en/rest)