Module github

Module github 

Source
Expand description

GitHub Releases API helpers.

Fetches release metadata and returns typed asset information including the download URL and optional SHA-256 digest for checksum verification.

The digest field in the GitHub API response has the format sha256:<hex>. Asset::sha256 strips the prefix so the hex string can be passed directly to super::http::download_verified.

ยงAuthentication

All requests use a shared [reqwest::blocking::Client] that sets the required User-Agent header and, when GH_TOKEN or GITHUB_TOKEN is present in the environment, an Authorization: Bearer header. This avoids 403 rate-limit errors in GitHub Actions where the token is always available.

Structsยง

Asset
A single asset from a GitHub release.
Release ๐Ÿ”’
The subset of a GitHub release response that we need.

Functionsยง

client ๐Ÿ”’
Builds a reqwest blocking client with the GitHub API User-Agent and, when available, an Authorization: Bearer token from the environment.
download_asset
Downloads a release asset to dest, using GitHub authentication when available.
fetch_latest_release_asset
Fetches the named asset from the latest GitHub release.
fetch_latest_release_asset_by_prefix
Fetches the first asset whose name starts with prefix from the latest GitHub release.
fetch_release_asset
Fetches the named asset from a GitHub release.
fetch_release_from_url ๐Ÿ”’