mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2025-12-16 19:57:44 +01:00
The 'name' field is optional per GitHub Actions specification. When omitted, GitHub displays the workflow file path relative to the repository root. This change removes the validation logic that incorrectly enforced the name field as required, aligning the validator with the official JSON schema which only requires 'on' and 'jobs' fields at the root level. Fixes #50
wrkflw-evaluator
Small, focused helper for statically evaluating GitHub Actions workflow files.
- Purpose: Fast structural checks (e.g.,
name,on,jobs) before deeper validation/execution - Used by:
wrkflwCLI and TUI during validation flows
Example
use std::path::Path;
let result = wrkflw_evaluator::evaluate_workflow_file(
Path::new(".github/workflows/ci.yml"),
/* verbose */ true,
).expect("evaluation failed");
if result.is_valid {
println!("Workflow looks structurally sound");
} else {
for issue in result.issues {
println!("- {}", issue);
}
}
Notes
- This crate focuses on structural checks; deeper rules live in
wrkflw-validators. - Most consumers should prefer the top-level
wrkflwCLI for end-to-end UX.