Github

GitHub Download Module

GitHub archive download functionality.

Handles downloading release archives from GitHub repositories.

Interfaces

DownloadOptions

Defined in: packages/core/src/github/download.ts:34

Options for downloading archives.

Extends
Properties
Property Type Description Inherited from Defined in
auth? AuthConfig Authentication configuration. ResolveVersionOptions.auth packages/core/src/github/releases.ts:83
defaultBranch? string Default branch to use when no releases/tags exist. ResolveVersionOptions.defaultBranch packages/core/src/github/releases.ts:95
downloadDir? string Custom download directory (uses temp by default). - packages/core/src/github/download.ts:40
format? "zip" | "tarball" Preferred archive format. - packages/core/src/github/download.ts:36
includePrereleases? boolean Include prereleases when resolving versions. ResolveVersionOptions.includePrereleases packages/core/src/github/releases.ts:87
latestCommit? string Latest commit SHA on default branch (for fallback). ResolveVersionOptions.latestCommit packages/core/src/github/releases.ts:97
onProgress? DownloadProgressCallback Progress callback. - packages/core/src/github/download.ts:38
timeout? number Request timeout in milliseconds. ResolveVersionOptions.timeout packages/core/src/github/releases.ts:85

DownloadResult

Defined in: packages/core/src/github/download.ts:46

Result of a download operation.

Properties
Property Type Description Defined in
archivePath string Path to the downloaded archive. packages/core/src/github/download.ts:48
commitSha? string Commit SHA if resolved to a commit (first 7 characters). packages/core/src/github/download.ts:54
format "zip" | "tarball" Archive format. packages/core/src/github/download.ts:52
tagName string Resolved tag/version name. packages/core/src/github/download.ts:50

Type Aliases

DownloadProgressCallback()

TypeScript
type DownloadProgressCallback = (progress) => void;

Defined in: packages/core/src/github/download.ts:23

Progress callback for downloads.

Parameters
Parameter Type
progress { bytesDownloaded?: number; message: string; percentage?: number; phase: "resolving" | "downloading"; totalBytes?: number; }
progress.bytesDownloaded? number
progress.message string
progress.percentage? number
progress.phase "resolving" | "downloading"
progress.totalBytes? number
Returns

void

Functions

downloadArchive()

TypeScript
function downloadArchive(url, options): Promise<string>;

Defined in: packages/core/src/github/download.ts:112

Download an archive from a URL.

Parameters
Parameter Type Description
url string URL to download
options { auth?: AuthConfig; downloadDir?: string; extension?: string; onProgress?: DownloadProgressCallback; timeout?: number; } Download options
options.auth? AuthConfig -
options.downloadDir? string -
options.extension? string -
options.onProgress? DownloadProgressCallback -
options.timeout? number -
Returns

Promise<string>

Path to downloaded file

downloadFromUrl()

TypeScript
function downloadFromUrl(url, options): Promise<string>;

Defined in: packages/core/src/github/download.ts:219

Download from a custom URL (non-GitHub).

Parameters
Parameter Type Description
url string URL to download
options { auth?: AuthConfig; downloadDir?: string; onProgress?: DownloadProgressCallback; timeout?: number; } Download options
options.auth? AuthConfig -
options.downloadDir? string -
options.onProgress? DownloadProgressCallback -
options.timeout? number -
Returns

Promise<string>

Path to downloaded file

downloadGitHubArchive()

TypeScript
function downloadGitHubArchive(
   owner,
   repo,
   version,
options): Promise<DownloadResult>;

Defined in: packages/core/src/github/download.ts:66

Download an archive from GitHub.

Parameters
Parameter Type Description
owner string Repository owner
repo string Repository name
version VersionSpec Version specification
options DownloadOptions Download options
Returns
Promise<DownloadResult>

Download result

GitHub Releases Module

GitHub releases API client.

Provides functions to query and resolve GitHub release versions.

Interfaces

GitHubOptions

Defined in: packages/core/src/github/releases.ts:81

Options for GitHub API requests.

Extended by
Properties
Property Type Description Defined in
auth? AuthConfig Authentication configuration. packages/core/src/github/releases.ts:83
includePrereleases? boolean Include prereleases when resolving versions. packages/core/src/github/releases.ts:87
timeout? number Request timeout in milliseconds. packages/core/src/github/releases.ts:85

GitHubRelease

Defined in: packages/core/src/github/releases.ts:21

GitHub release information.

Properties
Property Type Description Defined in
draft boolean Whether this is a draft. packages/core/src/github/releases.ts:37
htmlUrl string URL to the release page. packages/core/src/github/releases.ts:31
name string Release name/title. packages/core/src/github/releases.ts:25
prerelease boolean Whether this is a prerelease. packages/core/src/github/releases.ts:35
publishedAt string ISO timestamp when published. packages/core/src/github/releases.ts:33
tagName string Release tag name (e.g., “v1.0.0”). packages/core/src/github/releases.ts:23
tarballUrl string URL to download the tarball. packages/core/src/github/releases.ts:29
zipballUrl string URL to download the zipball. packages/core/src/github/releases.ts:27

GitHubTag

Defined in: packages/core/src/github/releases.ts:43

GitHub tag information.

Properties
Property Type Description Defined in
name string Tag name. packages/core/src/github/releases.ts:45
sha string Commit SHA. packages/core/src/github/releases.ts:47
tarballUrl string URL to download the tarball. packages/core/src/github/releases.ts:51
zipballUrl string URL to download the zipball. packages/core/src/github/releases.ts:49

ResolvedVersion

Defined in: packages/core/src/github/releases.ts:103

Result of version resolution.

Properties
Property Type Description Defined in
commitSha? string Commit SHA if resolved to a commit (first 7 characters). packages/core/src/github/releases.ts:111
tagName string Resolved tag/version name. packages/core/src/github/releases.ts:105
tarballUrl string URL to download the tarball. packages/core/src/github/releases.ts:109
zipballUrl string URL to download the zipball. packages/core/src/github/releases.ts:107

ResolveVersionOptions

Defined in: packages/core/src/github/releases.ts:93

Options for version resolution.

Extends
Extended by
Properties
Property Type Description Inherited from Defined in
auth? AuthConfig Authentication configuration. GitHubOptions.auth packages/core/src/github/releases.ts:83
defaultBranch? string Default branch to use when no releases/tags exist. - packages/core/src/github/releases.ts:95
includePrereleases? boolean Include prereleases when resolving versions. GitHubOptions.includePrereleases packages/core/src/github/releases.ts:87
latestCommit? string Latest commit SHA on default branch (for fallback). - packages/core/src/github/releases.ts:97
timeout? number Request timeout in milliseconds. GitHubOptions.timeout packages/core/src/github/releases.ts:85

Functions

constructArchiveUrl()

TypeScript
function constructArchiveUrl(
   owner,
   repo,
   ref,
   refType,
   format): string;

Defined in: packages/core/src/github/releases.ts:135

Construct a GitHub archive URL.

Parameters
Parameter Type Default value Description
owner string undefined Repository owner
repo string undefined Repository name
ref string undefined Git reference (tag, branch, or commit)
refType "tag" | "branch" | "commit" undefined Type of reference
format "zip" | "tarball" "zip" Archive format
Returns

string

Archive URL

fetchReleases()

TypeScript
function fetchReleases(
   owner,
   repo,
options): Promise<GitHubRelease[]>;

Defined in: packages/core/src/github/releases.ts:247

Fetch releases for a repository.

Parameters
Parameter Type Description
owner string Repository owner
repo string Repository name
options GitHubOptions GitHub options
Returns

Promise<<code><a href="#githubrelease" style="text-decoration-line: underline; text-decoration-style: dashed; text-decoration-thickness: 1px; text-decoration-color: currentColor;">GitHubRelease</a>[]</code>{=html}>

Array of releases

fetchTags()

TypeScript
function fetchTags(
   owner,
   repo,
options): Promise<GitHubTag[]>;

Defined in: packages/core/src/github/releases.ts:287

Fetch tags for a repository.

Parameters
Parameter Type Description
owner string Repository owner
repo string Repository name
options GitHubOptions GitHub options
Returns

Promise<<code><a href="#githubtag" style="text-decoration-line: underline; text-decoration-style: dashed; text-decoration-thickness: 1px; text-decoration-color: currentColor;">GitHubTag</a>[]</code>{=html}>

Array of tags

getLatestRelease()

TypeScript
function getLatestRelease(
   owner,
   repo,
options): Promise<GitHubRelease | null>;

Defined in: packages/core/src/github/releases.ts:317

Get the latest release for a repository.

Parameters
Parameter Type Description
owner string Repository owner
repo string Repository name
options GitHubOptions GitHub options
Returns
Promise<GitHubRelease | null>

Latest release or null if none

resolveVersion()

TypeScript
function resolveVersion(
   owner,
   repo,
   version,
options): Promise<ResolvedVersion>;

Defined in: packages/core/src/github/releases.ts:335

Resolve a version specification to a release or tag.

Parameters
Parameter Type Description
owner string Repository owner
repo string Repository name
version VersionSpec Version specification
options ResolveVersionOptions Resolution options
Returns
Promise<ResolvedVersion>

Resolved release/tag info with download URL

Back to top