diff --git a/wfe-yaml/src/executors/shell.rs b/wfe-yaml/src/executors/shell.rs index da9e55d..6db5a43 100644 --- a/wfe-yaml/src/executors/shell.rs +++ b/wfe-yaml/src/executors/shell.rs @@ -92,8 +92,21 @@ impl StepBody for ShellStep { && let Some(eq_pos) = rest.find('=') { let name = rest[..eq_pos].trim().to_string(); - let value = rest[eq_pos + 1..].to_string(); - outputs.insert(name, serde_json::Value::String(value)); + let raw_value = rest[eq_pos + 1..].to_string(); + // Auto-convert typed values from string annotations + let value = match raw_value.as_str() { + "true" => serde_json::Value::Bool(true), + "false" => serde_json::Value::Bool(false), + "null" => serde_json::Value::Null, + s if s.parse::().is_ok() => { + serde_json::Value::Number(s.parse::().unwrap().into()) + } + s if s.parse::().is_ok() => { + serde_json::json!(s.parse::().unwrap()) + } + _ => serde_json::Value::String(raw_value), + }; + outputs.insert(name, value); } } diff --git a/wfe-yaml/tests/e2e_yaml.rs b/wfe-yaml/tests/e2e_yaml.rs index 547a602..5325385 100644 --- a/wfe-yaml/tests/e2e_yaml.rs +++ b/wfe-yaml/tests/e2e_yaml.rs @@ -91,7 +91,7 @@ workflow: assert_eq!(greeting.as_str(), Some("hello")); } if let Some(count) = data.get("count") { - assert_eq!(count.as_str(), Some("42")); + assert_eq!(count.as_i64(), Some(42)); // auto-converted from string "42" } } } diff --git a/wfe-yaml/tests/shell.rs b/wfe-yaml/tests/shell.rs index f5f5834..6b2de05 100644 --- a/wfe-yaml/tests/shell.rs +++ b/wfe-yaml/tests/shell.rs @@ -106,7 +106,7 @@ workflow: assert_eq!(greeting.as_str(), Some("hello")); } if let Some(count) = data.get("count") { - assert_eq!(count.as_str(), Some("42")); + assert_eq!(count.as_i64(), Some(42)); // auto-converted from string "42" } if let Some(path) = data.get("path") { assert_eq!(path.as_str(), Some("/usr/local/bin"));