blob: fb392bc6e69d9c743f7c0e7de79b903f8009f598 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
//! Tools for the GitHub repository.
use anyhow::Context;
/// Obtain changes.txt for a given version/tag from the GitHub repository
pub async fn fetch_changes_text(version: &mullvad_version::Version) -> anyhow::Result<String> {
let github_changes_url = format!(
"https://raw.githubusercontent.com/mullvad/mullvadvpn-app/refs/tags/{version}/desktop/packages/mullvad-vpn/changes.txt"
);
let changes = reqwest::get(github_changes_url)
.await
.context("Failed to retrieve changes.txt (tag missing?)")?;
if let Err(err) = changes.error_for_status_ref() {
return Err(err).context("Error status returned when downloading changes.txt");
}
changes
.text()
.await
.context("Failed to retrieve text for changes.txt (tag missing?)")
}
|