action

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSHA

func IsSHA(s string) bool

IsSHA reports whether s looks like a 40-char hex commit SHA.

Types

type Ref

type Ref struct {
	Owner   string // "actions"
	Repo    string // "cache"
	Subpath string // "save" for actions/cache/save@v3 (no leading slash, empty if none)
	Ref     string // raw ref as written (branch/tag/SHA)
	IsSHA   bool   // 40-char hex
	// Comment fields are only populated when the source line had `# ...`.
	SrcRef      string // first whitespace-delimited token after `#`
	CommentTail string // remainder of comment after SrcRef (preserved as-is incl. leading space)
}

Ref is a parsed `uses:` action reference.

func ParseUsesValue

func ParseUsesValue(action, ref, srcRef, commentTail string) (Ref, bool)

ParseUsesValue parses the value portion of a `uses:` directive (the bit after `uses:`), e.g. "actions/checkout@v3 # v3 extra". Returns ok=false for non-pinnable values (docker://, ./local, malformed).

func (Ref) Action

func (r Ref) Action() string

Action returns "owner/repo" or "owner/repo/subpath".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL