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
reqwestblocking client with the GitHub APIUser-Agentand, when available, anAuthorization: Bearertoken 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
prefixfrom the latest GitHub release. - fetch_
release_ asset - Fetches the named asset from a GitHub release.
- fetch_
release_ ๐from_ url