mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2025-12-28 16:06:34 +01:00
fix: display error details for failed workflow executions
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -3,7 +3,7 @@ name: Test
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
jo:
|
||||
test:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2324,7 +2324,7 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
|
||||
|
||||
[[package]]
|
||||
name = "wrkflw"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bollard",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wrkflw"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
description = "A GitHub Actions workflow validator and executor"
|
||||
documentation = "https://github.com/bahdotsh/wrkflw"
|
||||
|
||||
16
src/ui.rs
16
src/ui.rs
@@ -540,10 +540,10 @@ impl App {
|
||||
},
|
||||
output: step_result.output.clone(),
|
||||
})
|
||||
.collect(),
|
||||
.collect::<Vec<StepExecution>>(),
|
||||
logs: vec![job_result.logs.clone()],
|
||||
})
|
||||
.collect();
|
||||
.collect::<Vec<JobExecution>>();
|
||||
}
|
||||
Err(e) => {
|
||||
let timestamp = Local::now().format("%H:%M:%S").to_string();
|
||||
@@ -551,6 +551,18 @@ impl App {
|
||||
.logs
|
||||
.push(format!("[{}] Error: {}", timestamp, e));
|
||||
execution_details.progress = 1.0;
|
||||
|
||||
// Create a dummy job with the error information so users can see details
|
||||
execution_details.jobs = vec![JobExecution {
|
||||
name: "Workflow Execution".to_string(),
|
||||
status: JobStatus::Failure,
|
||||
steps: vec![StepExecution {
|
||||
name: "Execution Error".to_string(),
|
||||
status: StepStatus::Failure,
|
||||
output: format!("Error: {}\n\nThis error prevented the workflow from executing properly.", e),
|
||||
}],
|
||||
logs: vec![format!("Workflow execution error: {}", e)],
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user