A comprehensive GitHub integration for the Autohive platform that enables full repository management, issue tracking, pull request workflows, commit operations, branch management, webhooks, gists, and file operations.
This integration provides complete access to GitHub's REST API (v2022-11-28), allowing you to automate your entire GitHub workflow through Autohive. Whether you're managing repositories, tracking issues, reviewing pull requests, or automating deployments with webhooks, this integration has you covered.
- Repository Management: Create, read, update, and delete repositories
- Issue Tracking: Full CRUD operations for issues and comments
- Pull Request Workflows: Create, review, merge, and manage pull requests
- Commit Operations: Access commit history and details
- Branch Management: Create, delete, and manage branches
- Webhook Integration: Set up automated workflows with webhooks
- File Operations: Read, create, update, and delete files directly in repositories
- Gist Management: Create and manage code snippets
- Rate Limiting: Built-in rate limit monitoring and handling
This integration uses GitHub's OAuth2 platform authentication for secure access to your GitHub account.
OAuth2 Platform Authentication via GitHub
The integration requests the following OAuth2 scopes:
repo- Full access to repositories (public and private)admin:repo_hook- Full control of repository webhooksadmin:org_hook- Full control of organization webhooksgist- Create and manage gistsuser- Access user profile informationread:user- Read user profile datauser:email- Access user email addressesuser:follow- Follow and unfollow usersadmin:org- Full control of organizations and teamsworkflow- Manage GitHub Actions workflowsadmin:public_key- Manage public SSH keysadmin:gpg_key- Manage GPG keyswrite:packages- Upload and publish packagesread:packages- Download and read packages
- In Autohive, navigate to Integrations
- Select "GitHub" integration
- Click "Connect" or "Authenticate"
- You'll be redirected to GitHub's OAuth authorization page
- Review the requested permissions and click "Authorize"
- You'll be redirected back to Autohive with the integration connected
Creates a new GitHub repository in your account or an organization.
Inputs:
name(string, required): Repository nameorg(string, optional): Organization name (leave empty for personal account)description(string, optional): Repository descriptionprivate(boolean, optional): Whether repository is private (default: false)auto_init(boolean, optional): Initialize with README (default: true)gitignore_template(string, optional): Gitignore template (e.g., 'Python', 'Node', 'Java')license_template(string, optional): License template (e.g., 'mit', 'apache-2.0', 'gpl-3.0')homepage(string, optional): Home page URLhas_issues(boolean, optional): Enable issues (default: true)has_projects(boolean, optional): Enable projects (default: true)has_wiki(boolean, optional): Enable wiki (default: true)
Outputs:
repository(object): Created repository details including id, name, url, clone_url, etc.result(boolean): Operation success statuserror(string): Error message if operation failed
Example:
{
"name": "my-awesome-project",
"description": "An awesome new project",
"private": false,
"auto_init": true,
"gitignore_template": "Python",
"license_template": "mit"
}Retrieves detailed information about a specific repository.
Inputs:
owner(string, required): Repository owner (username or organization)repo(string, required): Repository name
Outputs:
repository(object): Full repository detailsresult(boolean): Operation success status
Lists repositories for authenticated user, specific user, or organization.
Inputs:
type(string, optional): Type filter - "all", "owner", "public", "private", "member" (default: "all")sort(string, optional): Sort field - "created", "updated", "pushed", "full_name" (default: "updated")direction(string, optional): Sort direction - "asc" or "desc" (default: "desc")username(string, optional): Username to list repos for (leave empty for authenticated user)org(string, optional): Organization name to list repos forper_page(integer, optional): Results per page, 1-100 (default: 30)
Outputs:
repositories(array): List of repository objectsresult(boolean): Operation success status
Updates repository settings and configuration.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namename(string, optional): New repository namedescription(string, optional): New descriptionprivate(boolean, optional): Update visibilityhas_issues(boolean, optional): Enable/disable issueshas_wiki(boolean, optional): Enable/disable wiki
Outputs:
repository(object): Updated repository detailsresult(boolean): Operation success status
Permanently deletes a repository. Use with extreme caution!
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository name
Outputs:
result(boolean): Operation success statuserror(string): Error message if operation failed
Creates a new issue in a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nametitle(string, required): Issue titlebody(string, optional): Issue description (supports markdown)assignees(array, optional): Array of usernames to assignlabels(array, optional): Array of label names
Outputs:
issue(object): Created issue details including number, url, state, etc.result(boolean): Operation success status
Example:
{
"owner": "myusername",
"repo": "my-project",
"title": "Bug: Application crashes on startup",
"body": "## Description\nThe application crashes when...\n\n## Steps to Reproduce\n1. Launch app\n2. Click...",
"labels": ["bug", "priority-high"],
"assignees": ["developer1"]
}Retrieves details of a specific issue.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nameissue_number(integer, required): Issue number
Outputs:
issue(object): Issue detailsresult(boolean): Operation success status
Lists issues in a repository with powerful filtering options.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namestate(string, optional): "open", "closed", or "all" (default: "open")labels(string, optional): Comma-separated label namessort(string, optional): "created", "updated", or "comments" (default: "created")per_page(integer, optional): Results per page, 1-100 (default: 30)
Outputs:
issues(array): List of issue objectsresult(boolean): Operation success status
Updates an existing issue.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nameissue_number(integer, required): Issue numbertitle(string, optional): Updated titlebody(string, optional): Updated descriptionstate(string, optional): "open" or "closed"labels(array, optional): Updated label array
Outputs:
issue(object): Updated issue detailsresult(boolean): Operation success status
Adds a comment to an issue.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nameissue_number(integer, required): Issue numberbody(string, required): Comment text (supports markdown)
Outputs:
comment(object): Created comment detailsresult(boolean): Operation success status
Creates a new pull request.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nametitle(string, required): Pull request titlebody(string, optional): Pull request description (supports markdown)head(string, required): Branch to merge from (e.g., 'username:feature-branch')base(string, required): Branch to merge into (e.g., 'main' or 'master')draft(boolean, optional): Create as draft PR (default: false)
Outputs:
pull_request(object): Created pull request detailsresult(boolean): Operation success status
Example:
{
"owner": "myusername",
"repo": "my-project",
"title": "Add new authentication feature",
"body": "## Changes\n- Implemented OAuth2\n- Added tests\n\n## Testing\nTested on...",
"head": "myusername:feature/oauth",
"base": "main",
"draft": false
}Retrieves details of a specific pull request.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepull_number(integer, required): Pull request number
Outputs:
pull_request(object): Pull request detailsresult(boolean): Operation success status
Lists pull requests in a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namestate(string, optional): "open", "closed", or "all" (default: "open")sort(string, optional): "created", "updated", "popularity", "long-running" (default: "created")per_page(integer, optional): Results per page, 1-100 (default: 30)
Outputs:
pull_requests(array): List of pull request objectsresult(boolean): Operation success status
Merges a pull request.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepull_number(integer, required): Pull request numbercommit_title(string, optional): Merge commit titlecommit_message(string, optional): Merge commit messagemerge_method(string, optional): "merge", "squash", or "rebase" (default: "merge")
Outputs:
merge_result(object): Merge operation resultresult(boolean): Operation success status
Retrieves details of a specific commit.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namesha(string, required): Commit SHA
Outputs:
commit(object): Commit details including files changed, stats, etc.result(boolean): Operation success status
Lists commits in a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namesha(string, optional): Branch, tag, or SHA to start frompath(string, optional): Filter by file pathper_page(integer, optional): Results per page, 1-100 (default: 30)
Outputs:
commits(array): List of commit objectsresult(boolean): Operation success status
Retrieves details of a specific branch.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namebranch(string, required): Branch name
Outputs:
branch(object): Branch details including protection statusresult(boolean): Operation success status
Lists all branches in a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nameper_page(integer, optional): Results per page, 1-100 (default: 30)
Outputs:
branches(array): List of branch objectsresult(boolean): Operation success status
Creates a new branch from a commit SHA.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namebranch(string, required): New branch namesha(string, required): Commit SHA to branch from
Outputs:
ref(object): Created branch reference detailsresult(boolean): Operation success status
Deletes a branch from the repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namebranch(string, required): Branch name to delete
Outputs:
result(boolean): Operation success status
Compare two branches to see commits and file changes.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namebase_branch(string, required): Base branch (e.g., 'main')head_branch(string, required): Head branch (e.g., 'feature-branch')
Outputs:
status(string): Comparison status (e.g., 'ahead', 'diverged')ahead_by(integer): Number of commits aheadbehind_by(integer): Number of commits behindtotal_commits(integer): Total distinct commitscommits(array): List of commit objectsfiles(array): List of changed files with stats
Creates a new webhook for a repository to receive real-time events.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository nameurl(string, required): Webhook URL to receive POST requestsevents(array, required): Events to trigger webhook (e.g., ['push', 'pull_request', 'issues'])content_type(string, optional): "json" or "form" (default: "json")secret(string, optional): Secret for webhook signature validation
Outputs:
webhook(object): Created webhook detailsresult(boolean): Operation success status
Example:
{
"owner": "myusername",
"repo": "my-project",
"url": "https://myapp.com/webhooks/github",
"events": ["push", "pull_request", "issues", "issue_comment"],
"content_type": "json",
"secret": "my-webhook-secret"
}Common Webhook Events:
push- Git push to a repositorypull_request- Pull request opened, closed, or synchronizedissues- Issue opened, edited, deleted, etc.issue_comment- Comment added to an issue or PRcreate- Branch or tag createddelete- Branch or tag deletedrelease- Release publishedwatch- Repository starredfork- Repository forkedstatus- Commit status updateddeployment- Deployment createddeployment_status- Deployment status updated
Lists all webhooks for a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository name
Outputs:
webhooks(array): List of webhook objectsresult(boolean): Operation success status
Deletes a webhook from a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namehook_id(integer, required): Webhook ID
Outputs:
result(boolean): Operation success status
Retrieves the content of a file from a repository.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepath(string, required): File path in repository (e.g., 'src/main.py')ref(string, optional): Branch, tag, or commit SHA (defaults to default branch)
Outputs:
content(string): Decoded file contentsha(string): File SHA for updatesresult(boolean): Operation success status
Creates a new file in a repository via commit.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepath(string, required): File path in repositorymessage(string, required): Commit messagecontent(string, required): File content (will be base64 encoded automatically)branch(string, optional): Branch name (defaults to default branch)
Outputs:
commit(object): Commit detailsresult(boolean): Operation success status
Example:
{
"owner": "myusername",
"repo": "my-project",
"path": "src/new_feature.py",
"message": "Add new feature implementation",
"content": "def new_feature():\n return 'Hello World'",
"branch": "main"
}Updates an existing file in a repository via commit.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepath(string, required): File path in repositorymessage(string, required): Commit messagecontent(string, required): New file contentsha(string, required): Current file SHA (get fromget_file_content)branch(string, optional): Branch name
Outputs:
commit(object): Commit detailsresult(boolean): Operation success status
Deletes a file from a repository via commit.
Inputs:
owner(string, required): Repository ownerrepo(string, required): Repository namepath(string, required): File path in repositorymessage(string, required): Commit messagesha(string, required): Current file SHAbranch(string, optional): Branch name
Outputs:
commit(object): Commit detailsresult(boolean): Operation success status
Creates a new gist (code snippet).
Inputs:
description(string, optional): Gist descriptionpublic(boolean, optional): Whether gist is public (default: true)files(object, required): Files object with filename as key and content object as value
Outputs:
gist(object): Created gist details including urlresult(boolean): Operation success status
Example:
{
"description": "Example Python script",
"public": true,
"files": {
"example.py": {
"content": "print('Hello, World!')"
},
"README.md": {
"content": "# Example\nThis is a sample script."
}
}
}Retrieves current rate limit information for the authenticated user.
Inputs: None
Outputs:
rate_limit(object): Rate limit details including remaining requests, reset time, etc.result(boolean): Operation success status
Rate Limit Information:
- Authenticated requests: 5,000 requests per hour
- Search API: 30 requests per minute
- The response includes:
limit: Maximum requests per hourremaining: Remaining requests in current windowreset: Unix timestamp when limit resetsused: Number of requests used
autohive-integrations-sdk
This integration uses GitHub REST API version 2022-11-28.
GitHub enforces rate limits to ensure API stability:
- Authenticated requests: 5,000 requests per hour
- Search API: 30 requests per minute (authenticated)
- Unauthenticated requests: 60 requests per hour (not applicable with OAuth)
The integration includes built-in rate limit monitoring. Use the get_rate_limit action to check your current usage.
All actions include comprehensive error handling and return:
result: Boolean indicating success/failureerror: Detailed error message if operation failed
Common error scenarios:
- 401 Unauthorized: Invalid or expired OAuth token
- 403 Forbidden: Insufficient permissions or rate limit exceeded
- 404 Not Found: Repository, issue, or resource not found
- 422 Unprocessable Entity: Validation error in request data
{
"action": "create_issue",
"inputs": {
"owner": "myorg",
"repo": "customer-feedback",
"title": "Customer Feedback: {{form.subject}}",
"body": "**Customer:** {{form.name}}\n**Email:** {{form.email}}\n\n{{form.feedback}}",
"labels": ["customer-feedback", "needs-triage"]
}
}[
{
"action": "create_pull_request",
"inputs": {
"owner": "myorg",
"repo": "main-app",
"title": "Feature: {{feature_name}}",
"body": "## Changes\n{{changes_description}}\n\n## Testing\n{{test_results}}",
"head": "feature/{{feature_branch}}",
"base": "develop"
}
},
{
"action": "create_issue_comment",
"inputs": {
"owner": "myorg",
"repo": "main-app",
"issue_number": "{{previous_step.pull_request.number}}",
"body": "Automated tests passed! Ready for review. cc @reviewers"
}
}
]{
"action": "create_webhook",
"inputs": {
"owner": "myorg",
"repo": "production-app",
"url": "https://backup-service.myorg.com/github-webhook",
"events": ["push", "release"],
"secret": "{{env.WEBHOOK_SECRET}}"
}
}[
{
"action": "get_file_content",
"inputs": {
"owner": "myorg",
"repo": "config-repo",
"path": "config/production.json"
}
},
{
"action": "update_file",
"inputs": {
"owner": "myorg",
"repo": "config-repo",
"path": "config/production.json",
"message": "Update production config",
"content": "{{updated_config}}",
"sha": "{{previous_step.sha}}"
}
}
]- Use Specific Scopes: Only request OAuth scopes you actually need
- Monitor Rate Limits: Check rate limits periodically, especially for high-volume workflows
- Handle Errors Gracefully: Always check the
resultfield and handle errors appropriately - Use Webhooks: For real-time updates, use webhooks instead of polling
- Validate File SHAs: Always use the correct SHA when updating or deleting files
- Secure Webhook Secrets: Store webhook secrets securely and validate signatures
- Branch Protection: Use branch protection rules to prevent accidental deletions
- Test in Development: Test workflows in development repositories before production
- OAuth tokens are stored securely by Autohive platform
- Never expose webhook secrets in logs or error messages
- Use HTTPS for all webhook URLs
- Validate webhook signatures on your endpoint
- Regularly rotate OAuth tokens if possible
- Review granted scopes periodically
Issue: 401 Unauthorized
- Solution: Re-authenticate the integration in Autohive
Issue: 404 Not Found
- Solution: Verify repository owner, name, and resource identifiers are correct
Issue: 422 Validation Failed
- Solution: Check input parameters match the required format and constraints
Issue: 409 Conflict (when creating files)
- Solution: File already exists, use
update_fileinstead or check path
Issue: Rate limit exceeded
- Solution: Use
get_rate_limitto check status, wait for reset, or optimize requests
For integration issues or questions:
- Check the GitHub API Documentation
- Review this README for action details
- Contact Autohive support for platform-related issues
- 1.0.0 (Initial Release)
- Complete GitHub REST API integration
- OAuth2 platform authentication
- 30+ actions covering repositories, issues, PRs, commits, branches, webhooks, files, and gists
- Built-in rate limit handling
- Comprehensive error handling