Parse version from GitHub tag name instead of release name (#7423)
If we not change this, some release will parse error. https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28 ```json { "name": { "type": [ "string", "null" ] } } ``` <img width="1188" alt="image" src="https://github.com/zed-industries/zed/assets/5518/bd53dbc4-ae2c-4f19-afd7-58e70b4f87d8"> --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
bde509fa74
commit
e7fcddff69
13 changed files with 23 additions and 27 deletions
|
@ -11,7 +11,7 @@ pub struct GitHubLspBinaryVersion {
|
|||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct GithubRelease {
|
||||
pub name: String,
|
||||
pub tag_name: String,
|
||||
#[serde(rename = "prerelease")]
|
||||
pub pre_release: bool,
|
||||
pub assets: Vec<GithubReleaseAsset>,
|
||||
|
@ -58,9 +58,10 @@ pub async fn latest_github_release(
|
|||
let releases = match serde_json::from_slice::<Vec<GithubRelease>>(body.as_slice()) {
|
||||
Ok(releases) => releases,
|
||||
|
||||
Err(_) => {
|
||||
Err(err) => {
|
||||
log::error!("Error deserializing: {:?}", err);
|
||||
log::error!(
|
||||
"Error deserializing GitHub API response text: {:?}",
|
||||
"GitHub API response text: {:?}",
|
||||
String::from_utf8_lossy(body.as_slice())
|
||||
);
|
||||
return Err(anyhow!("error deserializing latest release"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue