command

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package command implements the gha subcommands: pin, update, and stats.

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

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