Docs

workflows

Source: crates/lvcs-action/src/workflow.rs.

/// `lvcs.toml`'s `[workflows]` (decision 245): `skip`, the action names
/// (`<file stem>/<job id>`, every cell of the job, or one cell's full
/// name) left out deliberately; `inputs`, an action's narrowed inputs by
/// name (`**`, every synced file, when unset); `vars`, the `vars` context;
/// and `repository`, `owner/name` for `github.repository`. Any other key
/// is refused at parse.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default, deny_unknown_fields)]
pub struct WorkflowsTable {
    /// Action names left out.
    pub skip: Vec<String>,
    /// Narrowed inputs, by action name.
    pub inputs: BTreeMap<String, InputsEntry>,
    /// The `vars` context.
    pub vars: BTreeMap<String, String>,
    /// `github.repository`.
    pub repository: Option<String>,
}

/// One `[workflows] inputs."<name>"` entry: gitignore-syntax patterns.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct InputsEntry {
    /// The paths the action covers.
    pub paths: Vec<String>,
    /// The paths it reads besides.
    #[serde(default)]
    pub uses: Vec<String>,
}

/// What one workflow file comes to: its actions, the jobs or cells it
/// skipped, why the whole file is ignored when it is, and the jobs it
/// refused.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct FileMapped {
    /// The file's path from the root.
    pub file: String,
    /// The canonical actions, in job and cell order.
    pub actions: Vec<Action>,
    /// What it skipped: a name and why.
    pub skipped: Vec<(String, String)>,
    /// Why no job of it counts, when none does.
    pub ignored: Option<String>,
    /// What it refused.
    pub refused: Vec<Refusal>,
    /// The workflow's `name`, which another's `workflow_run` names it by;
    /// its path when it has none, as GitHub does.
    pub workflow: String,
    /// The workflows its `workflow_run` follows, when it is triggered by
    /// one: [`combine`] resolves them to the channel its actions follow.
    pub follows: Vec<String>,
}

/// One refused job, cell, or file.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Refusal {
    /// The action name, or the file's path when the whole file is
    /// refused.
    pub name: String,
    /// The bounded reason.
    pub reason: ActionRefusal,
    /// What was refused, in words.
    pub detail: String,
    /// What to do: the exact `lvcs.toml` line, or the fix.
    pub next: String,
}