Skip to main content

download_release_assets

Function download_release_assets 

Source
pub fn download_release_assets(
    token: &str,
    repo: &Repo,
    tag: &str,
    names: &[&str],
    dir: &Path,
) -> Result<Vec<AssetFile>>
Expand description

Save each of names from the Release of tag, draft or published, into dir under its own name.

GitHub answers the asset API with a redirect to its storage. The token goes to GitHub only: the client follows no redirect itself, and fetches the storage URL without it (release assets).

ยงErrors

Returns an error when the GitHub client cannot be built, the Release does not exist or does not list one of names, or GitHub reports no SHA-256 digest for one. It also returns one when a download fails or a file cannot be written.