Struct GithubActionsDependency
pub struct GithubActionsDependency {
pub name: PackageName,
pub name_range: Range,
pub version_req: Option<VersionReq>,
pub version_range: Option<Range>,
pub version_literal: Option<String>,
pub pin: Option<PinStyle>,
pub source: DependencySource,
pub is_plain_scalar: bool,
}Expand description
Parsed uses: dependency from a GitHub Actions workflow file, with position tracking.
name is owner/repo — truncated at the second / for a subdirectory action
(github/codeql-action/init@v3 -> github/codeql-action) or a reusable-workflow call
(owner/repo/.github/workflows/x.yml@ref -> owner/repo).
Fields§
§name: PackageNameowner/repo identity.
name_range: RangeLSP range of the owner/repo text (truncated at the second /).
version_req: Option<VersionReq>Normalized version requirement: the tag text for a [PinStyle::Tag] or a
[PinStyle::Sha] with a comment_tag, the raw SHA for a commentless
[PinStyle::Sha], the branch name for [PinStyle::Branch] — None for a
non-resolvable source.
version_range: Option<Range>LSP range of the ref text — for a [PinStyle::Sha] with a comment_tag, this
extends through the comment token (<40hex> # v4.2.0). None for a
non-resolvable source or a bare uses: owner/repo with no @ at all.
version_literal: Option<String>The raw literal text version_range spans, when it differs from version_req —
populated only for the SHA-with-comment form, where version_req is the
comment-derived tag but version_range spans the full <sha> # <tag> text.
pin: Option<PinStyle>How the ref is pinned; None for a non-resolvable source.
source: DependencySourceDependency source: DependencySource::Registry for any @ref form (tag, SHA,
or branch — all resolvable against the GitHub tags API by name alone),
DependencySource::Path for ./local, DependencySource::Url for
docker://image:tag and a reusable-workflow call.
is_plain_scalar: boolWhether the whole uses: value was written as a plain (unquoted) YAML scalar,
as opposed to single- or double-quoted (uses: "actions/checkout@v4").
For a quoted scalar, version_range spans text inside the quotes — writing
{sha} # {tag} there would place a # inside the string rather than starting a
YAML comment, producing a uses: value GitHub Actions rejects and that re-parses
as [PinStyle::Branch] (issue #473, spec 031 FR-010). A SHA-pin code action must
check this before writing any edit that assumes an unquoted YAML comment can
follow the ref text — see crate::formatter::GithubActionsFormatter::sha_pin_replacement_for’s
caller.
Trait Implementations§
§impl Clone for GithubActionsDependency
impl Clone for GithubActionsDependency
§fn clone(&self) -> GithubActionsDependency
fn clone(&self) -> GithubActionsDependency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for GithubActionsDependency
impl Debug for GithubActionsDependency
§impl Dependency for GithubActionsDependency
impl Dependency for GithubActionsDependency
§fn name(&self) -> &PackageName
fn name(&self) -> &PackageName
§fn name_range(&self) -> Range
fn name_range(&self) -> Range
§fn version_requirement(&self) -> Option<&VersionReq>
fn version_requirement(&self) -> Option<&VersionReq>
§fn version_range(&self) -> Option<Range>
fn version_range(&self) -> Option<Range>
§fn source(&self) -> DependencySource
fn source(&self) -> DependencySource
§fn version_literal(&self) -> Option<&str>
fn version_literal(&self) -> Option<&str>
Source§fn features_range(&self) -> Option<Range>
fn features_range(&self) -> Option<Range>
Source§fn markers(&self) -> Option<&str>
fn markers(&self) -> Option<&str>
python_version >= '3.8'). Ecosystem-specific, None if not supported
or not present on this dependency.Source§fn markers_range(&self) -> Option<Range>
fn markers_range(&self) -> Option<Range>
None if not supported or not present).impl Eq for GithubActionsDependency
§impl PartialEq for GithubActionsDependency
impl PartialEq for GithubActionsDependency
§fn eq(&self, other: &GithubActionsDependency) -> bool
fn eq(&self, other: &GithubActionsDependency) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GithubActionsDependency
Auto Trait Implementations§
impl Freeze for GithubActionsDependency
impl RefUnwindSafe for GithubActionsDependency
impl Send for GithubActionsDependency
impl Sync for GithubActionsDependency
impl Unpin for GithubActionsDependency
impl UnsafeUnpin for GithubActionsDependency
impl UnwindSafe for GithubActionsDependency
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more