Skip to main content

Module github

Module github 

Source
Expand description

Shared GitHub Releases helpers.

Several loaders — GraalVM CE here, and the forge family once it ports — resolve their versions straight off GitHub Releases. Listing the releases and reading an asset’s digest live here so no resolver carries its own copy.

@opys/dev’s github.ts is still the JS spelling of this while the forge-family loaders remain in TypeScript; it retires with them.

Structs§

GitHubAsset
A single asset on a release, mirroring the /releases API shape.
GitHubRelease
A single release entry from the /releases API.

Enums§

GitHubError
ReleaseSelector
Which release to take off the listing.

Constants§

GITHUB_API_BASE
Where the Releases API lives. Overridable per call so a resolver can point at a GitHub Enterprise host or a mirror, matching the api_base the Adoptium and Azul resolvers already take.

Functions§

fetch_github_release
Fetch the one release tagged tag, by address rather than by listing.
github_asset_sha256
The hex sha256 behind an asset’s digest field, when GitHub computed one.
list_github_releases
List all releases for repo (owner/name), newest first — a single page of up to 100. token raises the rate limit.
pick_github_release
Fetch repo’s releases and pick the one matching selector. Drafts are always skipped; filter further narrows candidates first — use it when the loader needs specific assets present, so Latest falls through to the newest release that actually qualifies.
pin_github_asset
An asset’s size and sha256, whatever it takes to know them.
select_github_release
Apply a selector to an already-narrowed candidate list. Pure — the caller has done the draft/filter pass.