GitHub Integration Guide
Overview
The GitHub integration allows your NINA workflows to interact with the GitHub API to search repositories, manage issues, pull requests, and repository files, and retrieve user information. It supports both GitHub.com and GitHub Enterprise via configurable server URL, and works with either Personal Access Token (PAT) or OAuth2.
Status
Supported resources and operations:
- Repository: Get, Get Issues, Search
- Issue: Create, Get, Update
- Pull Request: Get, Get All
- File: Get, Create
- User: Get, Get Repositories
Credential Configuration
Authentication Methods
1) Access Token (Personal Access Token)
| Field | Description | Example |
|---|---|---|
| Server | GitHub API base URL (Enterprise set your API URL) | https://api.github.com |
| User | Optional user hint | octocat |
| Access Token | Personal Access Token | ghp_xxx... |
How to create a Personal Access Token (classic) on GitHub.com:
- Go to GitHub.com → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a name like "GitHub Integration Tests"
- Select scopes (permissions):
public_repo(to read public repositories)read:user(to read user profile)read:org(optional, to read organization info)
- Click "Generate token"
- Copy the token immediately (you won't see it again!)
For GitHub Enterprise, use your Enterprise API URL in Server.
2) OAuth2
| Field | Description | Default |
|---|---|---|
| Server | GitHub API base URL | https://api.github.com |
| Client ID | OAuth2 client ID | |
| Client Secret | OAuth2 client secret | |
| Auth URL | Authorization URL | https://github.com/login/oauth/authorize |
| Access Token URL | Access Token URL | https://github.com/login/oauth/access_token |
| Scope | OAuth2 scopes | repo,admin:repo_hook,admin:org,admin:org_hook,gist,notifications,user,write:packages,read:packages,delete:packages,workflow |
Supported Resources and Operations
Repository
| Operation | Description |
|---|---|
| Get | Get a repository by owner and name |
| Get Issues | List issues for a repository (filters, sorting, pagination) |
| Search | Search repositories, issues, users, code, or commits |
Issue
| Operation | Description |
|---|---|
| Create | Create a new issue |
| Get | Get a single issue by number |
| Update | Update issue fields (state, title, body, labels, assignees) |
Pull Request
| Operation | Description |
|---|---|
| Get | Get a single pull request |
| Get All | Get all pull requests (filters and pagination) |
File
| Operation | Description |
|---|---|
| Get | Get file contents by path (optionally by ref) |
| Create | Create a new file with commit metadata |
User
| Operation | Description |
|---|---|
| Get | Get user information |
| Get Repositories | List repositories for a user (filters and pagination) |
Examples
Get Repository Issues
{
"integration_service": "github",
"resource": "repository",
"operation": "getIssues",
"parameters": {
"owner": {
"mode": "name",
"value": "n8n-io"
},
"repository": {
"mode": "name",
"value": "n8n"
},
"returnAll": false,
"limit": 20,
"additionalFields": {
"state": "open",
"sort": "created",
"direction": "desc"
}
}
}
Search Repositories
{
"integration_service": "github",
"resource": "repository",
"operation": "search",
"parameters": {
"searchType": "repositories",
"query": "topic:security language:go stars:>1000",
"returnAll": false,
"limit": 10,
"additionalFields": {
"sort": "stars",
"order": "desc"
}
}
}
Create Issue
{
"integration_service": "github",
"resource": "issue",
"operation": "create",
"parameters": {
"owner": {"mode": "name", "value": "octocat"},
"repository": {"mode": "name", "value": "hello-world"},
"title": "Bug: unexpected error in workflow",
"body": "Steps to reproduce...",
"additionalFields": {"labels": "bug,high-priority"}
}
}
Best Practices
- Use least-privilege scopes for tokens.
- Prefer OAuth2 for multi-user or app contexts.
- For Enterprise, ensure the Server URL points to your API endpoint.
- Respect rate limits and implement pagination with
returnAll/limit.