Documentation
¶
Overview ¶
Package ghactions provides functions to replace tags for checksums in GitHub Actions workflows.
Index ¶
- Variables
- func GetChecksum(ctx context.Context, ghcli *github.Client, action, ref string) (string, error)
- func IsLocal(input string) bool
- func ModifyReferencesInYAML(ctx context.Context, ghcli *github.Client, node *yaml.Node) (bool, error)
- func ParseActionReference(input string) (action string, reference string, err error)
- func TraverseGitHubActionWorkflows(bfs billy.Filesystem, base string, fun TraverseFunc) error
- type TraverseFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidAction is returned when parsing the action fails. ErrInvalidAction = fmt.Errorf("invalid action") )
Functions ¶
func GetChecksum ¶
GetChecksum returns the checksum for a given action and tag.
func ModifyReferencesInYAML ¶
func ModifyReferencesInYAML(ctx context.Context, ghcli *github.Client, node *yaml.Node) (bool, error)
ModifyReferencesInYAML takes the given YAML structure and replaces all references to tags with the checksum of the tag. Note that the given YAML structure is modified in-place. The function returns true if any references were modified.
func ParseActionReference ¶
ParseActionReference parses an action reference into action and reference.
func TraverseGitHubActionWorkflows ¶
func TraverseGitHubActionWorkflows(bfs billy.Filesystem, base string, fun TraverseFunc) error
TraverseGitHubActionWorkflows traverses the GitHub Actions workflows in the given directory and calls the given function with each workflow.
Types ¶
Click to show internal directories.
Click to hide internal directories.