Documentation
¶
Overview ¶
Package command implements the gha subcommands: pin, update, and stats.
Index ¶
- Variables
- func RunList(paths []string, opts ListOptions) error
- func RunPin(paths []string, opts PinOptions) error
- func RunPolicy(paths []string, opts PolicyOptions) error
- func RunStats(workflowArg string, opts StatsOptions) error
- func RunUpdate(paths []string, opts UpdateOptions) error
- type ListOptions
- type PinOptions
- type PolicyOptions
- type StatsOptions
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
var ErrCheckFailed = errors.New("")
ErrCheckFailed signals that a command found problems and the process should exit non-zero, without printing an additional error line — the human-readable findings have already been written to stdout. Used by `pin` (unpinned actions) so it can gate CI.
Functions ¶
func RunList ¶
func RunList(paths []string, opts ListOptions) error
RunList prints a read-only inventory of the actions referenced in the repo, grouped by file, with pinned/floating status and (unless --offline) the latest available version.
func RunPin ¶
func RunPin(paths []string, opts PinOptions) error
RunPin pins floating `uses:` refs to commit SHAs. Previews unless Apply.
func RunPolicy ¶ added in v1.1.0
func RunPolicy(paths []string, opts PolicyOptions) error
RunPolicy shows the repo's allowed-actions policy next to one generated from the local workflow files. Read-only: nothing is written to GitHub.
func RunStats ¶
func RunStats(workflowArg string, opts StatsOptions) error
RunStats reports workflow run health and timing.
func RunUpdate ¶
func RunUpdate(paths []string, opts UpdateOptions) error
RunUpdate shows current vs latest versions and re-pins selected actions.
Types ¶
type ListOptions ¶
type ListOptions struct {
JSON bool
Offline bool
Outdated bool // only show outdated actions
Unpinned bool // only show floating (not SHA-pinned) actions
}
ListOptions configures the list command.
type PinOptions ¶
type PinOptions struct {
Apply bool // when false (default), only preview
Comment bool // append a `# <version>` trailing comment
}
PinOptions configures the pin command.
type PolicyOptions ¶ added in v1.1.0
type PolicyOptions struct {
Repo string
JSON bool
Apply bool // write the proposed policy to the repo settings
NoRequirePin bool // do not turn on sha_pinning_required when applying
}
PolicyOptions configures the policy command.
type StatsOptions ¶
type StatsOptions struct {
Repo string
Branch string
Since string // time window, e.g. "7d", "2w", "24h"
Jobs bool
JSON bool
}
StatsOptions configures the stats command.
type UpdateOptions ¶
type UpdateOptions struct {
Yes bool // update every outdated action without prompting
}
UpdateOptions configures the update command.