Documentation ¶
Overview ¶
Package actions provides utilities to work with GitHub Actions.
Index ¶
- Constants
- Variables
- func GetChecksum(ctx context.Context, cfg config.GHActions, restIf interfaces.REST, ...) (string, error)
- func ParseActionReference(input string) (action string, reference string, err error)
- type Parser
- func (_ *Parser) ConvertToEntityRef(reference string) (*interfaces.EntityRef, error)
- func (p *Parser) GetRegex() string
- func (p *Parser) Replace(ctx context.Context, matchedLine string, restIf interfaces.REST, ...) (*interfaces.EntityRef, error)
- func (p *Parser) SetCache(cache store.RefCacher)
- func (p *Parser) SetRegex(regex string)
Constants ¶
View Source
const ( // GitHubActionsRegex is regular expression pattern to match GitHub Actions usage GitHubActionsRegex = `uses:\s*[^\s]+/[^\s]+@[^\s]+|uses:\s*docker://[^\s]+:[^\s]+` // ReferenceType is the type of the reference ReferenceType = "action" )
Variables ¶
View Source
var ( // ErrInvalidAction is returned when parsing the action fails. ErrInvalidAction = errors.New("invalid action") // ErrInvalidActionReference is returned when parsing the action reference fails. ErrInvalidActionReference = errors.New("action reference is not a tag nor branch") )
Functions ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a struct to replace action references with digests
func (*Parser) ConvertToEntityRef ¶
func (_ *Parser) ConvertToEntityRef(reference string) (*interfaces.EntityRef, error)
ConvertToEntityRef converts an action reference to an EntityRef
func (*Parser) GetRegex ¶
GetRegex returns the regular expression pattern to match GitHub Actions usage
func (*Parser) Replace ¶
func (p *Parser) Replace( ctx context.Context, matchedLine string, restIf interfaces.REST, cfg config.Config, ) (*interfaces.EntityRef, error)
Replace replaces the action reference with the digest
Click to show internal directories.
Click to hide internal directories.