> ## Documentation Index
> Fetch the complete documentation index at: https://ai-kb.automationanywhere.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Repository management, issues, and pull requests

## Configuración

<img src="https://mintcdn.com/automationanywhere/RfM0IZSr51luSoHU/img/agents-toolkits/39.1.jpg?fit=max&auto=format&n=RfM0IZSr51luSoHU&q=85&s=9e450bdaca3a6e31195c093d85e394f7" alt="GitHub configuration with default owner/repository and authentication" width="1280" height="631" data-path="img/agents-toolkits/39.1.jpg" />

<img src="https://mintcdn.com/automationanywhere/RfM0IZSr51luSoHU/img/agents-toolkits/39.2.jpg?fit=max&auto=format&n=RfM0IZSr51luSoHU&q=85&s=7ca43fb6835933b392c9608e1bdd407d" alt="GitHub File Management, Issue Management, and Pull Request tools" width="1280" height="597" data-path="img/agents-toolkits/39.2.jpg" />

<img src="https://mintcdn.com/automationanywhere/RfM0IZSr51luSoHU/img/agents-toolkits/39.3.jpg?fit=max&auto=format&n=RfM0IZSr51luSoHU&q=85&s=dc1239e1c89be44c1207543fff31d55d" alt="GitHub Labels Management tools" width="1280" height="122" data-path="img/agents-toolkits/39.3.jpg" />

* **Default Owner/Organization**: octocat
* **Default Repository**: Hello-World
* **Authentication**: OAuth; prompts user to authenticate
* **Access**: Limited by user permissions; supports public/private repos and managing issues/PRs/repo content

## Available Tools (16/16)

### Repository Management

* **List Repositories**: Get all repos for users or organizations.
* **Get Repository**: Retrieve repo details.
* **Search Repositories**: Find repos by name, description, or topics.
* **List Branches**: Get all branches in the repository.

### Issue & PR Management

* **List Issues**: Query issues by state, labels, or assignee.
* **Create Issue**: Create issues with title, body, and labels.
* **List Pull Requests**: Get all PRs by state or branch.
* **Create Pull Request**: Open PR from branch to branch.
* **Get Pull Request**: Retrieve PR details.
* **Get PR Files**: List all files changed in pull request.
* **Get PR Diff**: Get the diff for a pull request.
* **Get PR Commits**: View all commits in pull request.

### Code History & Labels

* **Get Commit History**: View commit history for repository.
* **Get Labels**: Retrieve all labels from the repository.
* **Assign PR Labels**: Tag pull requests with labels.

## Casos de Uso

* **Issue Tracking**: Create and manage GitHub issues from reports or alerts.
* **Code Reviews**: List and review pull requests automatically.
* **Release Management**: Track commits and manage releases.
* **Project Management**: Sync GitHub issues with project workflows.

## Mejores Prácticas

* **Branch Protection**: Enable protection on main branches before automation.
* **PR Validation**: Check PR mergeability before attempting merge.
* **Rate Limits**: Monitor rate limits (5,000/hour for authenticated requests).

## Common Issues & Solutions

* **403 Forbidden**: Verify token has required scopes and repository access.
* **Merge Conflict**: Cannot auto-merge PR with conflicts. Resolve conflicts first.
* **Rate Limit**: Implement exponential backoff and conditional requests with ETags.
* **Branch Protection**: PR reviews or checks required before merge. Configure automation accordingly.
