GitHub
Manage repositories, issues, and pull requests via the GitHub API.
Authentication
| Type | Default | Details |
|---|---|---|
api_key | ✅ | Personal Access Token (ghp_... or classic PAT) |
oauth_2 | GitHub OAuth App or GitHub App token |
Both PATs and OAuth tokens ship as Authorization: Bearer <token>. The handler doesn't need to distinguish.
Endpoints
| Path | Risk | Description |
|---|---|---|
repos.get | read | Get a repository's metadata. |
repos.list | read | List repositories accessible to the user. |
issues.list | read | List issues in a repository. |
issues.get | read | Get a single issue. |
issues.create | write | Open a new issue. |
issues.comment | write | Comment on an issue or pull request. |
pullRequests.list | read | List pull requests. |
pullRequests.get | read | Get a pull request. |
pullRequests.merge | destructive | Merge a pull request. |
repos.get
Get a repository's metadata.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
Output: GithubRepo
repos.list
List repositories accessible to the authenticated user.
Input:
| Field | Type | Description |
|---|---|---|
per_page | number | Results per page |
page | number | Page number |
Output: GithubRepo[]
issues.list
List issues in a repository.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
state | string | open, closed, or all | |
per_page | number | Results per page |
Output: GithubIssue[]
issues.get
Get a single issue.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
issue_number | number | ✅ | Issue number |
Output: GithubIssue
issues.create
Create a new issue.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
title | string | ✅ | Issue title |
body | string | Issue body (Markdown) | |
labels | string[] | Label names |
Output: GithubIssue
issues.comment
Add a comment to an issue or pull request.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
issue_number | number | ✅ | Issue/PR number |
body | string | ✅ | Comment body |
Output: { id: number; body: string }
pullRequests.list
List pull requests in a repository.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
state | string | open, closed, all |
Output: GithubPullRequest[]
pullRequests.get
Get a single pull request.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
pull_number | number | ✅ | PR number |
Output: GithubPullRequest
pullRequests.merge
Merge a pull request.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Repository owner |
repo | string | ✅ | Repository name |
pull_number | number | ✅ | PR number |
merge_method | enum | merge, squash, or rebase (default: merge) |
Output: { merged: boolean; sha: string }
Usage
import { createFabric } from "@fabricorg/integrations";
import { github } from "@fabricorg/integrations/plugins";
const fabric = createFabric({
plugins: [
github({ authType: "api_key", token: process.env.GITHUB_TOKEN }),
],
});
// List repos
const repos = await fabric.github.api.repos.list({ per_page: 10 });
// Create an issue
const issue = await fabric.github.api.issues.create({
owner: "fabricorg",
repo: "integrations",
title: "Bug: timeout on large payloads",
body: "## Steps to reproduce\n...",
labels: ["bug", "p1"],
});
// Merge a PR
const result = await fabric.github.api.pullRequests.merge({
owner: "fabricorg",
repo: "integrations",
pull_number: 42,
merge_method: "squash",
});Webhooks
GitHub webhooks are not yet implemented in this plugin. Phase 6 will add support for push, pull_request, issues, and workflow_run events.
Types
interface GithubRepo {
id: number;
full_name: string;
private: boolean;
default_branch: string;
}
interface GithubIssue {
id: number;
number: number;
title: string;
state: string;
body: string | null;
html_url: string;
}
interface GithubPullRequest {
id: number;
number: number;
title: string;
state: string;
merged: boolean;
head: { ref: string; sha: string };
base: { ref: string };
}