Files
wrkflw/crates/validators
bahdotsh 5ea60e0a3d fix: squash review nits — double parse, clippy warnings, lost flag
Three leftover issues from the codebase review PR:

The from_json() deserialization was parsing the JSON *twice* — once
into serde_json::Value to sniff for the old nonce field, then again
from the raw string into the actual struct. Parse once, use
from_value() on the already-parsed Value. Not rocket science.

The cycle detector had two clippy warnings: .iter().cloned().collect()
on a slice (just use .to_vec(), please) and .min_by_key() cloning a
double reference instead of comparing properly. Switch to .min_by()
with an explicit cmp.

The show_action_messages flag was being silently dropped in
execute_workflow_cli — hardcoded to false regardless of what the user
asked for. Propagate it through the function signature and the TUI
fallback path so it actually does something.
2026-04-01 23:02:53 +05:30
..
2025-09-05 08:22:15 +05:30

wrkflw-validators

Validation utilities for workflows and steps.

  • Validates GitHub Actions sections: jobs, steps, actions references, triggers
  • GitLab pipeline validation helpers
  • Matrix-specific validation

Example

use serde_yaml::Value;
use wrkflw_models::ValidationResult;
use wrkflw_validators::{validate_jobs, validate_triggers};

let yaml: Value = serde_yaml::from_str(r#"name: demo
on: [workflow_dispatch]
jobs: { build: { runs-on: ubuntu-latest, steps: [] } }
"#).unwrap();

let mut res = ValidationResult::new();
if let Some(on) = yaml.get("on") {
    validate_triggers(on, &mut res);
}
if let Some(jobs) = yaml.get("jobs") {
    validate_jobs(jobs, &mut res);
}
assert!(res.is_valid);