#[non_exhaustive]pub struct WorkflowDispatch {
pub workflow: String,
pub git_ref: Option<String>,
pub fields: Vec<(String, String)>,
}Expand description
Options for GitHubApi::workflow_dispatch (gh workflow run), which fires a
workflow_dispatch event for a workflow that declares an on: workflow_dispatch
trigger.
#[non_exhaustive], so build it through WorkflowDispatch::new (the workflow
selector) and the chained git_ref /
field setters rather than a struct literal — the
≥2 options → builder rule (a target ref and any number of inputs) the
crate applies to its multi-option commands.
Inputs are emitted as -f/--raw-field key=value (the raw string form),
not gh’s -F/--field: the latter interprets a value beginning with @ as a
file to read (gh help api’s @ syntax), so a caller-supplied value like
@/etc/passwd would exfiltrate a file into the dispatch. --raw-field treats
every value as a literal string, so an arbitrary input value (including a leading
- or @) is passed verbatim and safely.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workflow: StringThe workflow to run — its file name (ci.yml / release.yml) or its display
name (gh’s [<workflow-id> | <workflow-name>] positional). A bare positional,
so it is flag-injection guarded (a leading - / empty value is refused before
spawning), like release_view’s tag.
git_ref: Option<String>The branch or tag whose version of the workflow file to run (--ref); None
runs the version on the repository’s default branch. Rides in a flag-VALUE
slot (gh consumes the next token verbatim, like --branch), so no positional
guard applies.
fields: Vec<(String, String)>workflow_dispatch inputs, as ordered (key, value) pairs. Each is emitted as
--raw-field key=value (see the type-level note on why --raw-field, not
--field). Keys must be non-empty after trimming and cannot contain = or
NUL; values can be any string (a leading -/@ is safe in this flag-VALUE
slot).
Implementations§
Trait Implementations§
Source§impl Clone for WorkflowDispatch
impl Clone for WorkflowDispatch
Source§fn clone(&self) -> WorkflowDispatch
fn clone(&self) -> WorkflowDispatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more