Skip to content

GitHubProvider

Defined in: vcs/github.ts:125

A VcsProvider implementation for GitHub, backed by the GitHub REST API.

new GitHubProvider(options): GitHubProvider

Defined in: vcs/github.ts:142

VcsProviderOptions

GitHubProvider

branchExists(project, branchName): Promise<boolean>

Defined in: vcs/github.ts:203

Returns whether a branch exists in a project.

VcsProjectRef

string

Promise<boolean>

VcsProvider.branchExists


buildAuthenticatedRemoteUrl(token, projectPath): string

Defined in: vcs/github.ts:343

Builds a token-authenticated remote URL suitable for push/tag operations (e.g. git remote add).

string

string

string

VcsProvider.buildAuthenticatedRemoteUrl


buildChangeRequestUrl(projectUrl, changeRequestIid): string

Defined in: vcs/github.ts:339

Builds the browser URL for a merge/pull request, given the project’s own web URL. The path differs per platform — GitLab nests it under /-/merge_requests/, GitHub under /pull/.

string

string | number

string

VcsProvider.buildChangeRequestUrl


buildCiCloneUrl(ciJobToken, projectPath): string

Defined in: vcs/github.ts:347

Builds a CI-job-token-authenticated remote URL suitable for a read-only git clone.

string

string

string

VcsProvider.buildCiCloneUrl


commitFile(project, branchName, commitMessage, filePath, content): Promise<VcsCommit>

Defined in: vcs/github.ts:231

Commits new content for a single file to a branch.

VcsProjectRef

string

string

string

string

Promise<VcsCommit>

VcsProvider.commitFile


compareRefs(project, from, to): Promise<VcsCommitLogEntry[]>

Defined in: vcs/github.ts:193

Lists the commits reachable from to but not from from (e.g. between two tags/SHAs).

VcsProjectRef

string

string

Promise<VcsCommitLogEntry[]>

VcsProvider.compareRefs


createBranch(project, branchName, ref): Promise<VcsBranch>

Defined in: vcs/github.ts:217

Creates a branch from a reference point (usually the project’s default branch).

VcsProjectRef

string

string

Promise<VcsBranch>

VcsProvider.createBranch


createMergeRequest(project, sourceBranch, targetBranch, title, description, labels?): Promise<VcsMergeRequest>

Defined in: vcs/github.ts:271

Creates a new merge/pull request.

VcsProjectRef

string

string

string

string

string[]

Promise<VcsMergeRequest>

VcsProvider.createMergeRequest


findOpenMergeRequest(project, sourceBranch, targetBranch): Promise<VcsMergeRequest | undefined>

Defined in: vcs/github.ts:257

Finds an existing open merge/pull request with the given source and target branch, if any.

VcsProjectRef

string

string

Promise<VcsMergeRequest | undefined>

VcsProvider.findOpenMergeRequest


getCiContext(): VcsCiContext

Defined in: vcs/github.ts:158

Reads the upstream repository’s identity from this platform’s CI environment variables.

VcsCiContext

VcsProvider.getCiContext


getFileContent(project, filePath, ref): Promise<string>

Defined in: vcs/github.ts:187

Fetches the raw content of a file from a project at a given ref.

VcsProjectRef

string

string

Promise<string>

VcsProvider.getFileContent


getProjectVariables(project): Promise<VcsProjectVariable[]>

Defined in: vcs/github.ts:322

Fetches project/repo-level CI variables. Returns an empty array if unreadable.

VcsProjectRef

Promise<VcsProjectVariable[]>

VcsProvider.getProjectVariables


listProjects(orgId): Promise<VcsProject[]>

Defined in: vcs/github.ts:165

Lists all projects/repos under a group/org, including subgroups where the platform has them.

string | number

Promise<VcsProject[]>

VcsProvider.listProjects


updateMergeRequest(project, mergeRequest, title, description, labels?): Promise<VcsMergeRequest>

Defined in: vcs/github.ts:298

Updates an existing merge/pull request’s title, description, and labels.

VcsProjectRef

VcsMergeRequest

string

string

string[]

Promise<VcsMergeRequest>

VcsProvider.updateMergeRequest

readonly apiUrl: string

Defined in: vcs/github.ts:139

The API base URL this provider talks to, derived from the host unless overridden.

VcsProvider.apiUrl


readonly host: string

Defined in: vcs/github.ts:137

The instance hostname this provider was built for.

VcsProvider.host


readonly kind: "github"

Defined in: vcs/github.ts:129

VcsProvider.kind


readonly terminology: VcsTerminology

Defined in: vcs/github.ts:131

The platform’s vocabulary, for composing user-facing text.

VcsProvider.terminology


readonly static defaultHost: "github.com" = 'github.com'

Defined in: vcs/github.ts:127

Used when no --vcs-host is supplied, so selecting a provider is enough to reach its SaaS instance.