From 17d50b68ce6b7573eb07f6b63d304df28bd3cce9 Mon Sep 17 00:00:00 2001 From: Eliot Eikenberry Date: Fri, 16 Aug 2024 11:28:20 -0700 Subject: [PATCH] fix: allow a 3rd option for workflow link (#31) Co-authored-by: Wolftousen --- src/helpers/loki.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers/loki.rs b/src/helpers/loki.rs index 682d63f..da8fcf2 100644 --- a/src/helpers/loki.rs +++ b/src/helpers/loki.rs @@ -97,6 +97,7 @@ pub struct WorkflowRun { pub head_sha: String, pub workflow_id: Option, pub url: Option, + pub html_url: Option, } #[derive(Deserialize, Debug)] @@ -260,7 +261,9 @@ async fn sort_deploy_data(data: QueryResponse) -> HashMap { - if wf.workflow_id.is_some() { + if wf.html_url.is_some() { + wf_url = wf.html_url.unwrap() + } else if wf.workflow_id.is_some() { wf_url = d.url.replace("api.", "").replace("repos/", "").replace("deployments/", "actions/runs/").replace(d.id.to_string().as_str(), wf.workflow_id.unwrap().to_string().as_str()); } else if wf.url.is_some() { wf_url = wf.url.unwrap().replace("api.", "").replace("repos/", "");