Documentation
¶
Overview ¶
Package uses classifies `uses:` values, so every caller decides what a value is the same way and an unparseable reference can't be mistaken for one that is deliberately not a repository action.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct {
// Name is the image reference without `docker://`, or the Dockerfile
// path for ImageBuild.
Name string
Kind ImageKind
// Where names the job, service, `$/` action or remote action using it.
Where string
// Action is the remote action (owner/repo[/path]@ref) that names the
// image, so only its maintainer can pin it. Empty when the repository does.
Action string
}
Image is a container image a workflow runs that the lockfile can't pin.
func ClassifyImage ¶
ClassifyImage trims `docker://` from raw and returns the image it names, unless it's pinned by an `@sha256:` digest or empty.
type ImageKind ¶
type ImageKind int
ImageKind is how a container image is chosen when it isn't pinned by digest.
type Kind ¶
type Kind int
Kind is what a `uses:` value refers to.
const ( // Empty is a blank value. Empty Kind = iota // Action is a remote repository action, in Ref.Action. Action // Local is a `./…` path in the same checkout. Local // Docker is a `docker://` image. Docker // Expression contains `${{ … }}` and is only known at run time. Expression // SelfRepository is a `$/…` reference to the defining repository. SelfRepository // ReusableWorkflow is a remote owner/repo/.github/workflows/x.yml@ref, // valid only at jobs.<job_id>.uses. ReusableWorkflow // Invalid is a value the Actions backend rejects; Ref.Problem says why. Invalid )
type Ref ¶
type Ref struct {
Kind Kind
// Raw is the trimmed value.
Raw string
// Action is set when Kind is Action.
Action parserlock.ActionRef
// Problem, set when Kind is Invalid, completes "uses: <Raw> …".
Problem string
}
Ref is a classified `uses:` value.
Click to show internal directories.
Click to hide internal directories.