Fetches a specific branch by name.
GET /repos/{owner}/{repo}/branches/{branch}
The branch name (e.g., 'main')
The branch object
Fetches branches for this repository.
GET /repos/{owner}/{repo}/branches
Optionalparams: BranchesParamsOptional filters: protected, per_page, page
A paged response of branches
Returns a CommitResource for a given commit ref (SHA, branch, or tag).
Commit SHA, branch name, or tag name
A chainable commit resource
Fetches commits for this repository.
GET /repos/{owner}/{repo}/commits
Optionalparams: CommitsParamsOptional filters: sha, path, author, since, until, per_page, page
A paged response of commits
Fetches the contents of a file or directory in this repository.
GET /repos/{owner}/{repo}/contents/{path}
Returns a single GitHubContent for files, or an array for directories.
Optionalpath: stringPath to the file or directory. Omit for root.
Optionalparams: ContentParamsOptional: ref (branch, tag, or commit SHA)
Fetches contributors to this repository.
GET /repos/{owner}/{repo}/contributors
Optionalparams: PaginationParams & { anon?: boolean }Optional filters: anon, per_page, page
Creates a fork of this repository.
POST /repos/{owner}/{repo}/forks
Note: Forking is asynchronous on GitHub's side. The returned repository may not be fully ready immediately after this call returns.
Optionaldata: CreateForkDataOptional: target organization, custom name, default-branch-only flag
The newly created fork
Creates an issue in this repository.
POST /repos/{owner}/{repo}/issues
Issue data. title is required.
The created issue
Creates a webhook on this repository.
POST /repos/{owner}/{repo}/hooks
Webhook configuration. config.url is required.
The created webhook
Fetches the forks of this repository.
GET /repos/{owner}/{repo}/forks
Optionalparams: ForksParamsOptional filters: sort, per_page, page
A paged response of forked repositories
Fetches the repository details.
GET /repos/{owner}/{repo}
The repository object
Returns an IssueResource for a given issue number.
The returned resource can be awaited directly to fetch issue info, or chained to access sub-resources (comments).
The issue number within the repository
A chainable issue resource
Fetches issues for this repository.
GET /repos/{owner}/{repo}/issues
Note: GitHub returns pull requests as issues in this endpoint.
Filter them out by checking for the absence of pull_request.
Optionalparams: IssuesParamsOptional filters: state, labels, sort, direction, since, per_page, page
A paged response of issues
Fetches the latest published release for this repository.
GET /repos/{owner}/{repo}/releases/latest
The latest release object
Returns a PullRequestResource for a given pull request number.
The pull request number (not the ID)
A chainable pull request resource
Fetches pull requests for this repository.
GET /repos/{owner}/{repo}/pulls
Optionalparams: PullRequestsParamsOptional filters: state, head, base, sort, direction, per_page, page
A paged response of pull requests
Fetches the raw text content of a file in this repository.
Uses Accept: application/vnd.github.raw+json.
GET /repos/{owner}/{repo}/contents/{filePath}
Path to the file (e.g., 'src/index.ts')
Optionalparams: ContentParamsOptional: ref (branch, tag, or commit SHA)
The raw file content as a string
Fetches releases for this repository.
GET /repos/{owner}/{repo}/releases
Optionalparams: ReleasesParamsOptional pagination: per_page, page
A paged response of releases
Fetches tags for this repository.
GET /repos/{owner}/{repo}/tags
Optionalparams: TagsParamsOptional pagination: per_page, page
A paged response of tags
Allows the resource to be awaited directly, resolving with the repository info. Delegates to RepositoryResource.get.
Optionalonfulfilled: null | (value: GitHubRepository) => TResult1 | PromiseLike<TResult1>Optionalonrejected: null | (reason: unknown) => TResult2 | PromiseLike<TResult2>Fetches the repository topics.
GET /repos/{owner}/{repo}/topics
An array of topic strings
Updates an existing webhook on this repository.
PATCH /repos/{owner}/{repo}/hooks/{hook_id}
The webhook ID
Fields to update
The updated webhook
Fetches webhooks configured on this repository.
GET /repos/{owner}/{repo}/hooks
Optionalparams: WebhooksParamsOptional pagination: per_page, page
A paged response of webhooks
Represents a GitHub repository resource with chainable async methods.
Implements
PromiseLike<GitHubRepository>so it can be awaited directly to fetch repository info, while also exposing sub-resource methods.Example